Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 2 and Doctrine 2
#12

[eluser]kkruecke[/eluser]
Quote: I tried something similar except that I dont have a CLI.
Assuming you installed Doctrine using pear
Code:
$ sudo pear install pear.doctrine-project.org/doctrineORM

Code:
$ pear list -c pear.doctrine-project.org
Installed packages, channel pear.doctrine-project.org:
======================================================
Package        Version    State
DoctrineCommon 2.0.0RC1   beta
DoctrineDBAL   2.0.0BETA4 beta
DoctrineORM    2.0.0BETA4 beta
and (on Ubuntu, for example) these packages are now located in /usr/share/php/Doctrine
Code:
$ ls -1 /usr/share/php/Doctrine
Common
DBAL
ORM
Symfony
and the doctrine command line utility is installed into /usr/bin. With this setup, then this is a version of cli-config.php you can use. cli-config.php goes in your project's folder. Don't place it in /usr/bin. Change the database connection settings, of course, to your settings.

Code:
<?php
require_once 'Doctrine/Common/ClassLoader.php';

$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();

$config = new \Doctrine\ORM\Configuration();
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities"));
$config->setMetadataDriverImpl($driverImpl);

$config->setProxyDir(__DIR__ . '/Proxies');
$config->setProxyNamespace('Proxies');

$connectionOptions = array(     'driver' => 'pdo_mysql',
    'dbname' => 'bugs',
     'user' => 'bugs',
    'password' => 'sY7Rsk47',
    ''host' => 'localhost' );

$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);

$helperSet = 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)
));
There instructions are also at http://wp.me/pj3WD-vn.


Messages In This Thread
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-04-2010, 02:39 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-06-2010, 03:55 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-07-2010, 04:10 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-08-2010, 05:59 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-08-2010, 09:38 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-19-2010, 01:59 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-20-2010, 07:59 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 07-28-2010, 05:02 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 09-04-2010, 02:09 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 09-13-2010, 04:24 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 10-13-2010, 10:16 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 10-27-2010, 10:27 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 11-01-2010, 12:41 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 11-11-2010, 02:00 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 01-04-2011, 08:00 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 01-04-2011, 08:53 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 01-04-2011, 04:38 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 01-16-2011, 02:45 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 01-16-2011, 03:07 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 02-08-2011, 07:53 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 02-16-2011, 03:21 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 02-16-2011, 03:40 PM
CodeIgniter 2 and Doctrine 2 - by El Forum - 02-04-2012, 11:28 AM
CodeIgniter 2 and Doctrine 2 - by El Forum - 03-23-2012, 09:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB