Created
April 23, 2014 13:22
-
-
Save h4cc/11214984 to your computer and use it in GitHub Desktop.
Redirecting packages.json for Composer/Satis.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This file generates a new package.json on STDOUT, that will | |
* include the other package.json files. | |
* | |
* @author Julius Beckmann <beckmann@silpion.de> | |
* | |
* Documentation on this: | |
* https://github.com/composer/composer/blob/c849f7d05d4eb5e585c34c83bd41341bc144f0d0/doc/05-repositories.md | |
*/ | |
$webDir = 'web/'; | |
$files = array( | |
// Public Mirror and index. | |
'public/packages.json', | |
// Private Silpion packages index. | |
'private/packages.json', | |
); | |
$includes = array(); | |
foreach($files as $file) { | |
if(file_exists($webDir . $file)) { | |
$includes[$file] = array( | |
'sha1' => sha1_file($webDir . $file), | |
); | |
} | |
} | |
echo json_encode( | |
array( | |
'includes' => $includes, | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment