source: pro-violet-viettel/sourcecode/application/doctrine.php @ 345

Last change on this file since 345 was 345, checked in by quyenla, 11 years ago

collaborator page

File size: 1.9 KB
Line 
1<?php
2
3// trailing slash is important!
4define('APPPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
5define('BASEPATH', APPPATH);
6define('ENVIRONMENT', 'production');
7
8require APPPATH.'libraries/Doctrine.php';
9
10$doctrine = new Doctrine();
11 
12$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
13    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($doctrine->em->getConnection()),
14    'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($doctrine->em)
15));
16
17$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface (CodeIgniter integration by Joel Verhagen)', Doctrine\ORM\Version::VERSION);
18$cli->setCatchExceptions(true);
19$cli->setHelperSet($helperSet);
20$cli->addCommands(array(
21    // DBAL Commands
22    new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
23    new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
24 
25    // ORM Commands
26    new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
27    new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
28    new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
29    new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
30    new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
31    new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
32    new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
33    new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
34    new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
35    new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
36    new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
37    new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
38    new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
39    new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
40 
41));
42$cli->run();
Note: See TracBrowser for help on using the repository browser.