Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
merged branch Ascendor/master (PR #59)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Commits
-------

7602498 Removed second parameter of json_encode call for PHP versions prior to 5.3. This parameter is not available for these versions, resulting in a warning and an empty file packages.json

Discussion
----------

Compatibility patch for PHP 5.2.x

Removed second parameter of json_encode call for PHP versions prior to 5.3.

This parameter is not available for these versions, resulting in a warning and an empty file packages.json.

http://de.php.net/json_encode
  • Loading branch information
fabpot committed Oct 31, 2012
2 parents 897f071 + 7602498 commit 4852c2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pirum
Expand Up @@ -676,7 +676,11 @@ pear install <?php echo $this->server->alias ?>/package_name-beta</code></pre>
}
}

file_put_contents($this->buildDir.'/packages.json', json_encode($repository, JSON_PRETTY_PRINT));
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
file_put_contents($this->buildDir.'/packages.json',json_encode($repository, JSON_PRETTY_PRINT));
} else {
file_put_contents($this->buildDir.'/packages.json',json_encode($repository));
}
}

protected function createComposerConstraint(array $data)
Expand Down

0 comments on commit 4852c2e

Please sign in to comment.