}
}
if (!$loader) {
    throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');
}
foreach ($directories as $directory) {
    $configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php';
    if (file_exists($configFile)) {
        break;
    }
}
if (!file_exists($configFile)) {
    ConsoleRunner::printCliConfigTemplate();
    exit(1);
}
if (!is_readable($configFile)) {
    echo 'Configuration file [' . $configFile . '] does not have read permission.' . PHP_EOL;
    exit(1);
}
$commands = array();
$helperSet = (require $configFile);
if (!$helperSet instanceof HelperSet) {
    foreach ($GLOBALS as $helperSetCandidate) {
        if ($helperSetCandidate instanceof HelperSet) {
            $helperSet = $helperSetCandidate;
            break;
        }
    }
}
ConsoleRunner::run($helperSet, $commands);
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../app/resources/dependencyContainer.php";
use Doctrine\DBAL\Tools\Console\ConsoleRunner;
$connection = $deps["database"];
return ConsoleRunner::createHelperSet($connection);
<?php

use Doctrine\DBAL\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
use ImmutableStateStatusTracker\bootstrap;
require_once __DIR__ . '/bootstrap.php';
$entityManager = bootstrap::getEntityManager();
$helperSet = ConsoleRunner::createHelperSet($entityManager->getConnection());
$helperSet->set(new EntityManagerHelper($entityManager), 'em');
return $helperSet;
Exemple #4
0
<?php

/**
 * @file
 */
$application = (require __DIR__ . '/../bootstrap.php');
use Doctrine\DBAL\Tools\Console\ConsoleRunner;
$connection = $application['dbal_connection'];
$commands = [new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand()];
$helperSet = ConsoleRunner::createHelperSet($connection);
$helperSet->set(new \Symfony\Component\Console\Helper\DialogHelper(), 'dialog');
return $helperSet;
end($commands)->setMigrationConfiguration($config);
$commands[] = new GenerateCommand();
end($commands)->setMigrationConfiguration($config);
$commands[] = new MigrateCommand();
end($commands)->setMigrationConfiguration($config);
$commands[] = new StatusCommand();
end($commands)->setMigrationConfiguration($config);
$commands[] = new VersionCommand();
end($commands)->setMigrationConfiguration($config);
$commands[] = new MetadataCommand();
$commands[] = new ResultCommand();
$commands[] = new QueryCommand();
$commands[] = new CreateCommand();
$commands[] = new UpdateCommand();
$commands[] = new DropCommand();
$commands[] = new EnsureProductionSettingsCommand();
$commands[] = new ConvertDoctrine1SchemaCommand();
$commands[] = new GenerateRepositoriesCommand();
$commands[] = new GenerateEntitiesCommand();
$commands[] = new GenerateProxiesCommand();
$commands[] = new ConvertMappingCommand();
$commands[] = new RunDqlCommand();
$commands[] = new ValidateSchemaCommand();
$commands[] = new InfoCommand();
$commands[] = new MappingDescribeCommand();
$commands[] = new App\Command\ImportMappingDoctrineCommand();
end($commands)->setEntityManager($em);
$cli->addCommands($commands);
// Register All Doctrine DBAL Commands
ConsoleRunner::addCommands($cli);
return $cli;