SamsonGame/utils/composer/update.php

23 lines
567 B
PHP
Raw Permalink Normal View History

2021-12-29 20:50:11 +03:00
<?php
$VERSION = "2.1.14";
$SHA = "d44a904520f9aaa766e8b4b05d2d9a766ad9a6f03fa1a48518224aad703061a4";
$PHAR = __DIR__ . "/composer-$VERSION.phar";
if(!file_exists($PHAR))
{
echo "Downloading composer...\n";
copy("http://getcomposer.org/download/$VERSION/composer.phar", $PHAR);
if(hash_file('sha256', $PHAR) !== $SHA)
{
unlink($PHAR);
throw new Exception("Check summs don't match: $SHA VS " . hash_file('sha256', $PHAR));
}
}
system("cd " . __DIR__ . " && php $PHAR update --no-dev", $ret);
if($ret != 0)
throw new Exception("Update error");