composer 910 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env php
  2. <?php
  3. require __DIR__.'/../src/bootstrap.php';
  4. use Composer\Console\Application;
  5. error_reporting(-1);
  6. if (function_exists('ini_set')) {
  7. @ini_set('display_errors', 1);
  8. $memoryInBytes = function ($value) {
  9. $unit = strtolower(substr($value, -1, 1));
  10. $value = (int) $value;
  11. switch($unit) {
  12. case 'g':
  13. $value *= 1024;
  14. case 'm':
  15. $value *= 1024;
  16. case 'k':
  17. $value *= 1024;
  18. }
  19. return $value;
  20. };
  21. $memoryLimit = trim(ini_get('memory_limit'));
  22. // Increase memory_limit if it is lower than 512M
  23. if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 512 * 1024 * 1024) {
  24. @ini_set('memory_limit', '512M');
  25. }
  26. unset($memoryInBytes, $memoryLimit);
  27. }
  28. // run the command application
  29. $application = new Application();
  30. $application->run();