1
0
mirror of synced 2025-03-06 04:46:13 +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();
// Set up Metadata Drivers
$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__ . "/Entities"));
$driverImpl = $config->newDefaultAnnotationDriver([__DIR__ . "/Entities"]);
$config->setMetadataDriverImpl($driverImpl);
// Set up caches, depending on $debug variable.
@ -33,10 +33,10 @@ $config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies');
// Database connection information
$connectionOptions = array(
$connectionOptions = [
'driver' => 'pdo_sqlite',
'path' => 'database.sqlite'
);
];
// Enable second-level cache
$cacheConfig = new \Doctrine\ORM\Cache\CacheConfiguration();
@ -52,4 +52,4 @@ $cacheConfig->setCacheFactory($factory);
$config->setSecondLevelCacheEnabled(true);
$config->setSecondLevelCacheConfiguration($cacheConfig);
return EntityManager::create($connectionOptions, $config);
return EntityManager::create($connectionOptions, $config);

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->setCatchExceptions(true);
$cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet(array(
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
)));
$cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet(
[
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
]
));
$cli->addCommands(array(
$cli->addCommands(
[
// DBAL Commands
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
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\ValidateSchemaCommand(),
));
]
);
$cli->run();