2009-08-31 20:21:29 +04:00
|
|
|
<?php
|
2009-09-11 23:50:48 +04:00
|
|
|
#
|
|
|
|
# This configuration file is loaded by the Doctrine CLI whenever you execute
|
|
|
|
# a task. A CLI configuration file usually initializes two local variables:
|
|
|
|
#
|
|
|
|
# $em - An EntityManager instance that the CLI tasks should use.
|
2009-11-01 22:04:27 +03:00
|
|
|
# $globalArguments - An array of default command line arguments that are passed to all
|
|
|
|
# CLI tasks automatically when an argument is not specifically set on
|
|
|
|
# the command line.
|
2009-09-11 23:50:48 +04:00
|
|
|
#
|
|
|
|
# You can create several CLI configuration files with different names, for different databases.
|
|
|
|
# Every CLI task recognizes the --config=<path> option where you can specify the configuration
|
|
|
|
# file to use for a particular task. If this option is not given, the CLI looks for a file
|
|
|
|
# named "cli-config.php" (this one) in the same directory and uses that by default.
|
|
|
|
#
|
|
|
|
|
2009-12-16 00:06:32 +03:00
|
|
|
require_once __DIR__ . '/../../lib/Doctrine/Common/ClassLoader.php';
|
2009-09-11 23:50:48 +04:00
|
|
|
|
2009-12-16 00:06:32 +03:00
|
|
|
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
|
2009-09-11 23:50:48 +04:00
|
|
|
$classLoader->register();
|
2009-08-31 20:21:29 +04:00
|
|
|
|
2009-12-16 00:06:32 +03:00
|
|
|
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
|
2009-10-15 00:18:36 +04:00
|
|
|
$classLoader->register();
|
|
|
|
|
2009-08-31 20:21:29 +04:00
|
|
|
$config = new \Doctrine\ORM\Configuration();
|
|
|
|
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
|
2009-10-15 00:18:36 +04:00
|
|
|
$config->setProxyDir(__DIR__ . '/Proxies');
|
|
|
|
$config->setProxyNamespace('Proxies');
|
2009-09-11 23:50:48 +04:00
|
|
|
|
2009-08-31 20:21:29 +04:00
|
|
|
$connectionOptions = array(
|
2009-10-09 21:51:06 +04:00
|
|
|
'driver' => 'pdo_sqlite',
|
|
|
|
'path' => 'database.sqlite'
|
2009-08-31 20:21:29 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
|
2009-10-30 03:15:53 +03:00
|
|
|
|
2009-12-21 20:38:14 +03:00
|
|
|
$configuration = new \Doctrine\Common\Cli\Configuration();
|
|
|
|
$configuration->setAttribute('em', $em);
|