Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: php

php:
- 7.1
- 7.2
- 7.3

matrix:
allow_failures:
- php: 7.3

before_install:
- composer self-update

install:
- composer install --dev --no-interaction

before_script:
- mkdir -p build/logs

script:
- php vendor/bin/phpunit

after_success:
- travis_retry php vendor/bin/php-coveralls
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# PhpinfoComparator

[![Build Status](https://travis-ci.org/ngmy/phpinfocmp.svg?branch=master)](https://travis-ci.org/ngmy/phpinfocmp)
[![Coverage Status](https://coveralls.io/repos/github/ngmy/phpinfocmp/badge.svg?branch=master)](https://coveralls.io/github/ngmy/phpinfocmp?branch=master)

PhpinfoComparator is compare two `phpinfo()` files.

## Requirements

PhpinfoComparator has the following requirements:

* PHP >= 7.1.0

## Installation

Install PhpinfoComparator globally as a system wide by using the Composer:

```sh
composer global require ngmy/phpinfocmp
```

Or alternatively, install PhpinfoComparator locally as part of your project by using the Composer:

```sh
composer require ngmy/phpinfocmp
```

## Usage

Compare two `phpinfo()` files on two remote servers:

```sh
phpinfocmp http://server1/phpinfo http://server2/phpinfo > phpinfo_diff.html
```

Compare two html `phpinfo()` files on one local machine:

```sh
phpinfocmp --fetch-mode1=file --fetch-mode2=file phpinfo1.html phpinfo2.html > phpinfo_diff.html
```

Compare two text `phpinfo()` files on one local machine:

```sh
phpinfocmp --fetch-mode1=file --fetch-mode2=file --file-format1=text --file-format2=text phpinfo1.txt phpinfo2.txt > phpinfo_diff.html
```

You can combine different fetch modes and file formats:

```sh
phpinfocmp --fetch-mode2=file http://server1/phpinfo phpinfo.html > phpinfo_diff.html
```

```sh
phpinfocmp --fetch-mode1=file --fetch-mode2=file --file-format2=text phpinfo.html phpinfo.txt > phpinfo_diff.html
```

You can read fetch options from a specified PHP file:

```sh
phpinfocmp --fetch-options1=fetch_options.php --fetch-options2=fetch_options.php https://server1/phpinfo https://server2/phpinfo > phpinfo_diff.html
```

The PHP file must be an array format that can be passed to `curl_setopt_array()` as following:

```php
<?php

return [
CURLOPT_SSL_VERIFYPEER => false,
];
```

## License

PhpinfoComparator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
18 changes: 18 additions & 0 deletions bin/phpinfocmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);

require __DIR__ . '/../vendor/autoload.php';

use Ngmy\PhpinfoComparator\Application\Runner;
use Ngmy\PhpinfoComparator\Infrastructure\{
ConsoleCommandLineCommandReadWriter,
ConsoleCommandLineParserFactory
};

$consoleCommandLineParser = ConsoleCommandLineParserFactory::create();
$commandReadWriter = new ConsoleCommandLineCommandReadWriter($consoleCommandLineParser);
$runner = new Runner($commandReadWriter);
$exitCode = $runner->runPhpinfocmp();

exit($exitCode);
50 changes: 50 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "ngmy/phpinfocmp",
"description": "PhpinfoComparator is compare two phpinfo() files.",
"type": "library",
"license": "MIT",
"keywords": [
"phpinfo",
"comparator",
"comparison",
"diff"
],
"authors": [
{
"name": "Yuta Nagamiya",
"email": "y.nagamiya@gmail.com"
}
],
"require": {
"php": ">=7.1.0",
"aura/di": "^3.0",
"cogpowered/finediff": "^0.3",
"pear/console_commandline": "^1.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"psr-4": {
"Ngmy\\PhpinfoComparator\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Ngmy\\PhpinfoComparator\\": "tests/"
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "7.1.0"
}
},
"bin": [
"bin/phpinfocmp"
]
}
Loading