1
0
mirror of synced 2025-03-06 12:56:10 +03:00

Use short-array syntax on "tools" directory

This commit is contained in:
Luís Cobucci 2016-12-07 23:32:17 +01:00
parent 6af1d2843f
commit 1d5e16e9d9
No known key found for this signature in database
GPG Key ID: 8042585A7DBC92E1
2 changed files with 14 additions and 10 deletions

View File

@ -19,7 +19,7 @@ $debug = true;
$config = new \Doctrine\ORM\Configuration(); $config = new \Doctrine\ORM\Configuration();
// Set up Metadata Drivers // Set up Metadata Drivers
$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__ . "/Entities")); $driverImpl = $config->newDefaultAnnotationDriver([__DIR__ . "/Entities"]);
$config->setMetadataDriverImpl($driverImpl); $config->setMetadataDriverImpl($driverImpl);
// Set up caches, depending on $debug variable. // Set up caches, depending on $debug variable.
@ -33,10 +33,10 @@ $config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies'); $config->setProxyNamespace('Proxies');
// Database connection information // Database connection information
$connectionOptions = array( $connectionOptions = [
'driver' => 'pdo_sqlite', 'driver' => 'pdo_sqlite',
'path' => 'database.sqlite' 'path' => 'database.sqlite'
); ];
// Enable second-level cache // Enable second-level cache
$cacheConfig = new \Doctrine\ORM\Cache\CacheConfiguration(); $cacheConfig = new \Doctrine\ORM\Cache\CacheConfiguration();

View File

@ -5,12 +5,15 @@ $em = require_once __DIR__.'/bootstrap.php';
$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION); $cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION);
$cli->setCatchExceptions(true); $cli->setCatchExceptions(true);
$cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet(array( $cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet(
[
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
))); ]
));
$cli->addCommands(array( $cli->addCommands(
[
// DBAL Commands // DBAL Commands
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
@ -34,5 +37,6 @@ $cli->addCommands(array(
new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(), new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
)); ]
);
$cli->run(); $cli->run();