芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/midiatech/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedRun.php
addOption('--environment', '-e', InputOption::VALUE_REQUIRED, 'The target environment'); $this->setName('seed:run') ->setDescription('Run database seeders') ->addOption('--seed', '-s', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'What is the name of the seeder?') ->setHelp( <<
seed:run command runs all available or individual seeders
phinx seed:run -e development
phinx seed:run -e development -s UserSeeder
phinx seed:run -e development -s UserSeeder -s PermissionSeeder -s LogSeeder
phinx seed:run -e development -v
EOT ); } /** * Run database seeders. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { $this->bootstrap($input, $output); $seedSet = $input->getOption('seed'); $environment = $input->getOption('environment'); if ($environment === null) { $environment = $this->getConfig()->getDefaultEnvironment(); $output->writeln('
warning
no environment specified, defaulting to: ' . $environment); } else { $output->writeln('
using environment
' . $environment); } $envOptions = $this->getConfig()->getEnvironment($environment); if (isset($envOptions['adapter'])) { $output->writeln('
using adapter
' . $envOptions['adapter']); } if (isset($envOptions['wrapper'])) { $output->writeln('
using wrapper
' . $envOptions['wrapper']); } if (isset($envOptions['name'])) { $output->writeln('
using database
' . $envOptions['name']); } else { $output->writeln('
Could not determine database name! Please specify a database name in your config file.
'); return; } if (isset($envOptions['table_prefix'])) { $output->writeln('
using table prefix
' . $envOptions['table_prefix']); } if (isset($envOptions['table_suffix'])) { $output->writeln('
using table suffix
' . $envOptions['table_suffix']); } $start = microtime(true); if (empty($seedSet)) { // run all the seed(ers) $this->getManager()->seed($environment); } else { // run seed(ers) specified in a comma-separated list of classes foreach ($seedSet as $seed) { $this->getManager()->seed($environment, trim($seed)); } } $end = microtime(true); $output->writeln(''); $output->writeln('
All Done. Took ' . sprintf('%.4fs', $end - $start) . '
'); } }