Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sarciszewski committed Apr 17, 2015
1 parent 6408344 commit ac65f05
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

Display the differences between all of the files in two PHP Archives.

Copyright 2015 [Paragon Initiative Enterprises](https://paragonie.com)
Copyright (c) 2015 [Paragon Initiative Enterprises](https://paragonie.com)

## Set up

```sh
ln -s ./pharaoh /usr/bin/pharaoh
```
1. Edit your php.ini file and set `phar.readonly` to `0` for PHP's CLI.
2. Optionally, symlink `/usr/bin/pharaoh` to the `pharaoh` file in the current
directory.

## Example

```sh
pharaoh composer.phar composer-from-source.phar
pharaoh composer-from-source.phar composer.phar
```

## Why?
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "paragonie/pharaoh",
"description": "Compare PHARs from the Command Line",
"version": "0.1.2",
"version": "0.2.0",
"keywords": [
"tool",
"utility",
"phar",
"security",
"auditing",
"diff"
],
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions pharaoh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ if (!empty($opts['c'])) {
$diff->listChecksums($opts['c']);
} elseif (!empty($opts['check'])) {
$diff->listChecksums($opts['check']);
} elseif (isset($opts['d']) || isset($opts['diff'])) {
$diff->printGnuDiff();
} else {
$diff->printGitDiff();
}
13 changes: 13 additions & 0 deletions src/Pharaoh/PharDiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ public function printGitDiff()
exit;
}

/**
* Prints a git-formatted diff of the two phars
*/
public function printGnuDiff()
{
// Lazy way. Will replace with custom implementaiton later.

$argA = \escapeshellarg($this->phars[0]->tmp);
$argB = \escapeshellarg($this->phars[1]->tmp);
echo `diff $argA $argB`;
exit;
}

public function listChecksums($algo)
{
list($pharA, $pharB) = $this->hashChildren(
Expand Down

0 comments on commit ac65f05

Please sign in to comment.