芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/cms.mgaplay.com.br/vendor/robmorgan/phinx/src/Phinx/Console/Command/Init.php
setName('init') ->setDescription('Initialize the application for Phinx') ->addArgument('path', InputArgument::OPTIONAL, 'Which path should we initialize for Phinx?') ->setHelp(sprintf( '%sInitializes the application for Phinx%s', PHP_EOL, PHP_EOL )); } /** * Initializes the application. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * @throws \RuntimeException * @throws \InvalidArgumentException * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { // get the migration path from the config $path = $input->getArgument('path'); if ($path === null) { $path = getcwd(); } $path = realpath($path); if (!is_writable($path)) { throw new \InvalidArgumentException(sprintf( 'The directory "%s" is not writable', $path )); } // Compute the file path $fileName = 'phinx.yml'; // TODO - maybe in the future we allow custom config names. $filePath = $path . DIRECTORY_SEPARATOR . $fileName; if (file_exists($filePath)) { throw new \InvalidArgumentException(sprintf( 'The file "%s" already exists', $filePath )); } // load the config template if (is_dir(__DIR__ . '/../../../data/Phinx')) { $contents = file_get_contents(__DIR__ . '/../../../data/Phinx/phinx.yml'); } else { $contents = file_get_contents(__DIR__ . '/../../../../phinx.yml'); } if (file_put_contents($filePath, $contents) === false) { throw new \RuntimeException(sprintf( 'The file "%s" could not be written to', $path )); } $output->writeln('
created
.' . str_replace(getcwd(), '', $filePath)); } }