芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/airport-back/vendor/codeception/codeception/src/Codeception/Command/SelfUpdate.php
*/ class SelfUpdate extends Command { /** * Class constants */ const NAME = 'Codeception'; const GITHUB_REPO = 'Codeception/Codeception'; const PHAR_URL = 'https://codeception.com/'; const PHAR_URL_PHP56 = 'https://codeception.com/php56/'; /** * Holds the current script filename. * @var string */ protected $filename; /** * {@inheritdoc} */ protected function configure() { if (isset($_SERVER['argv'][0])) { $this->filename = $_SERVER['argv'][0]; } else { $this->filename = \Phar::running(false); } $this ->setAliases(array('selfupdate')) ->setDescription( sprintf( 'Upgrade
%s
to the latest version', $this->filename ) ); parent::configure(); } /** * @return string */ protected function getCurrentVersion() { return Codecept::VERSION; } /** * {@inheritdoc} */ public function execute(InputInterface $input, OutputInterface $output) { $version = $this->getCurrentVersion(); $output->writeln( sprintf( '
%s
version
%s
', self::NAME, $version ) ); $url = $this->getPharUrl(); $updater = new Updater(null, false); $updater->getStrategy()->setPharUrl($url . 'codecept.phar'); $updater->getStrategy()->setVersionUrl($url . 'codecept.version'); try { if ($updater->hasUpdate()) { $output->writeln("\n
Updating...
"); $updater->update(); $output->writeln( sprintf("\n
%s
has been updated.\n", $this->filename) ); } else { $output->writeln('You are already using the latest version.'); } } catch (\Exception $e) { $output->writeln( sprintf( "
\n%s\n
", $e->getMessage() ) ); return 1; } return 0; } /** * Returns base url of phar file for current PHP version * * @return string */ protected function getPharUrl() { if (version_compare(PHP_VERSION, '7.2.0', '<')) { return self::PHAR_URL_PHP56; } return self::PHAR_URL; } }