Example #1
0
 public function __construct($argv)
 {
     parent::__construct($argv);
     $this->checkDependencies();
     $this->enforceCli();
     if (!$this->isSuperUser()) {
         $this->writeln('You must be root to use this tool!');
         $this->endWithError();
     }
     $this->conf = $this->conductorConfiguration();
     $this->mysql = MysqlPdo::connect('information_schema', $this->conf->mysql->username, $this->conf->mysql->password, $this->conf->mysql->host);
 }
Example #2
0
use Symfony\Component\Console\ {
    Application as CliApplication,
    Helper\HelperSet
};

use Doctrine\DBAL\ {
    Tools\Console\Helper\ConnectionHelper,
    Connection,
    Version
};

$app = require 'app/app.php';

$em = $app['em'];

$cli = new CliApplication('Doctrine Command Line Interface', Version::VERSION);
$cli->setCatchExceptions(true);

$cli->setHelperSet(new HelperSet([
    'db' => new ConnectionHelper($em->getConnection()),
    'em' => new EntityManagerHelper($em)
]));

$cli->addCommands([
    new Command\GenerateRepositoriesCommand,
    new Command\GenerateEntitiesCommand,
    new Command\ConvertMappingCommand,
    new Command\ValidateSchemaCommand,
    new Command\SchemaTool\CreateCommand,
    new Command\SchemaTool\UpdateCommand,
    new Command\GenerateProxiesCommand
Example #3
0
 /**
  * @inheritdoc
  */
 public function showHelp()
 {
     $this->printSign();
     parent::showHelp();
 }