cake.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/php -q
  2. <?php
  3. /**
  4. * Command-line code generation utility to automate programmer chores.
  5. *
  6. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  7. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  8. *
  9. * Licensed under The MIT License
  10. * For full copyright and license information, please see the LICENSE.txt
  11. * Redistributions of files must retain the above copyright notice.
  12. *
  13. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  14. * @link http://cakephp.org CakePHP(tm) Project
  15. * @since 2.0.0
  16. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  17. */
  18. $minVersion = '5.5.9';
  19. if (file_exists('composer.json')) {
  20. $composer = json_decode(file_get_contents('composer.json'));
  21. if (isset($composer->require->php)) {
  22. $minVersion = preg_replace('/([^0-9\.])/', '', $composer->require->php);
  23. }
  24. }
  25. if (version_compare(phpversion(), $minVersion, '<')) {
  26. fwrite(STDERR, sprintf("Minimum PHP version: %s. You are using: %s.\n", $minVersion, phpversion()));
  27. exit(-1);
  28. }
  29. include dirname(__DIR__) . '/config/bootstrap.php';
  30. exit(Cake\Console\ShellDispatcher::run($argv));