/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/migrations/src
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/migrations/src/AbstractSeed.php (3781B)
getOutput()->writeln('');
$this->getOutput()->writeln(
' ====' .
'
' . $seeder . ':' .
'
seeding'
);
$start = microtime(true);
$this->runCall($seeder);
$end = microtime(true);
$this->getOutput()->writeln(
' ====' .
'
' . $seeder . ':' .
'
seeded' .
' ' . sprintf('%.4fs', $end - $start) . ''
);
$this->getOutput()->writeln('');
}
/**
* Calls another seeder from this seeder.
* It will load the Seed class you are calling and run it.
*
* @param string $seeder Name of the seeder to call from the current seed
* @return void
*/
protected function runCall($seeder)
{
[$pluginName, $seeder] = pluginSplit($seeder);
$argv = [
'seed',
'--seed',
$seeder,
];
$plugin = $pluginName ?: $this->input->getOption('plugin');
if ($plugin !== null) {
$argv[] = '--plugin';
$argv[] = $plugin;
}
$connection = $this->input->getOption('connection');
if ($connection !== null) {
$argv[] = '--connection';
$argv[] = $connection;
}
$source = $this->input->getOption('source');
if ($source !== null) {
$argv[] = '--source';
$argv[] = $source;
}
$seedCommand = new Seed();
$input = new ArgvInput($argv, $seedCommand->getDefinition());
$seedCommand->setInput($input);
$config = $seedCommand->getConfig();
$seedPaths = $config->getSeedPaths();
require_once array_pop($seedPaths) . DS . $seeder . '.php';
/** @var \Phinx\Seed\SeedInterface $seeder */
$seeder = new $seeder();
$seeder->setOutput($this->getOutput());
$seeder->setAdapter($this->getAdapter());
$seeder->setInput($this->input);
$seeder->run();
}
/**
* Sets the InputInterface this Seed class is being used with.
*
* @param \Symfony\Component\Console\Input\InputInterface $input Input object.
* @return $this
*/
public function setInput(InputInterface $input)
{
$this->input = $input;
return $this;
}
}