Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 43 lines (32 sloc) 1.099 kB
#!/usr/bin/php
<?php
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Application;
use Symfony\Component\Finder\Finder;
require_once __DIR__ . '/bootstrap.php';
$helperSet = new HelperSet(array(
'db' => new ConnectionHelper($entityManager->getConnection()),
'em' => new EntityManagerHelper($entityManager)
));
$finder = new Finder();
$iterator = $finder
->files()
->name('*Scenario.php')
->in(__DIR__ . '/lib/CarDealer');
foreach ($iterator as $file) {
require_once $file->getRealpath();
}
$cli = new Application('Doctrine Command Line Interface', \Doctrine\ORM\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$classes = get_declared_classes();
foreach ($classes as $class) {
if (is_subclass_of($class, 'CarFramework\\ConsoleScenario')) {
$cli->add(new $class($entityManager));
}
}
ConsoleRunner::addCommands($cli);
$cli->run();
Jump to Line
Something went wrong with that request. Please try again.