Ejemplo n.º 1
0
 public function executeDoctrine(array $arguments)
 {
     $_SERVER['argv'] = array_slice($arguments, 1);
     $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', \Doctrine\Common\Version::VERSION);
     $cli->setCatchExceptions(true);
     $helperSet = $cli->getHelperSet();
     $helpers = array('em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($this->cx->getDb()->getEntityManager()));
     foreach ($helpers as $name => $helper) {
         $helperSet->set($helper, $name);
     }
     $cli->addCommands(array(new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(), new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(), new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(), new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(), new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(), new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand()));
     $cli->setAutoExit(false);
     return $cli->run();
 }
Ejemplo n.º 2
0
 * @license  http://www.opensource.org/licenses/mit-license.php MIT
 * @version  GIT: $Id
 * @link     https://github.com/BespokeSupport/TrelloUpdates
 */
use BespokeSupport\TrelloUpdates\BoardConfigCommand;
use BespokeSupport\TrelloUpdates\BoardSelectCommand;
use BespokeSupport\TrelloUpdates\CacheBoardsCommand;
use BespokeSupport\TrelloUpdates\CacheListsCommand;
use BespokeSupport\TrelloUpdates\CacheMemberCommand;
use BespokeSupport\TrelloUpdates\CredentialsCommand;
use BespokeSupport\TrelloUpdates\EmailSingleCommand;
use BespokeSupport\TrelloUpdates\HelperCommand;
require_once dirname(__FILE__) . '/vendor/autoload.php';
$application = new \Symfony\Component\Console\Application();
// let commands run after each other
$application->setAutoExit(false);
// master command
$application->add(new HelperCommand());
// sub command
$application->add(new CredentialsCommand());
// sub command
$application->add(new CacheMemberCommand());
// sub command
$application->add(new CacheBoardsCommand());
// sub command
$application->add(new CacheListsCommand());
// sub command
$application->add(new BoardSelectCommand());
// sub command
$application->add(new BoardConfigCommand());
// sub command