diff --git a/docs/en/cookbook/integrating-with-codeigniter.rst b/docs/en/cookbook/integrating-with-codeigniter.rst deleted file mode 100644 index 83af5ca202..0000000000 --- a/docs/en/cookbook/integrating-with-codeigniter.rst +++ /dev/null @@ -1,139 +0,0 @@ -Integrating with CodeIgniter -============================ - -This is recipe for using Doctrine 2 in your -`CodeIgniter `_ framework. - -.. note:: - - This might not work for all CodeIgniter versions and may require - slight adjustments. - - -Here is how to set it up: - -Make a CodeIgniter library that is both a wrapper and a bootstrap -for Doctrine 2. - -Setting up the file structure ------------------------------ - -Here are the steps: - - -- Add a php file to your system/application/libraries folder - called Doctrine.php. This is going to be your wrapper/bootstrap for - the D2 entity manager. -- Put the Doctrine folder (the one that contains Common, DBAL, and - ORM) inside that same libraries folder. -- Your system/application/libraries folder now looks like this: - - system/applications/libraries -Doctrine -Doctrine.php -index.html - -- If you want, open your config/autoload.php file and autoload - your Doctrine library. - - register(); - $entitiesClassLoader = new ClassLoader('models', rtrim(APPPATH, "/" )); - $entitiesClassLoader->register(); - $proxiesClassLoader = new ClassLoader('Proxies', APPPATH.'models/proxies'); - $proxiesClassLoader->register(); - - // Set up caches - $config = new Configuration; - $cache = new ArrayCache; - $config->setMetadataCacheImpl($cache); - $driverImpl = $config->newDefaultAnnotationDriver(array(APPPATH.'models/Entities')); - $config->setMetadataDriverImpl($driverImpl); - $config->setQueryCacheImpl($cache); - - $config->setQueryCacheImpl($cache); - - // Proxy configuration - $config->setProxyDir(APPPATH.'/models/proxies'); - $config->setProxyNamespace('Proxies'); - - // Set up logger - $logger = new EchoSQLLogger; - $config->setSQLLogger($logger); - - $config->setAutoGenerateProxyClasses( TRUE ); - - // Database connection information - $connectionOptions = array( - 'driver' => 'pdo_mysql', - 'user' => $db['default']['username'], - 'password' => $db['default']['password'], - 'host' => $db['default']['hostname'], - 'dbname' => $db['default']['database'] - ); - - // Create EntityManager - $this->em = EntityManager::create($connectionOptions, $config); - } - } - -Please note that this is a development configuration; for a -production system you'll want to use a real caching system like -APC, get rid of EchoSqlLogger, and turn off -autoGenerateProxyClasses. - -For more details, consult the :doc:`Doctrine 2 Configuration documentation `. - -Now to use it -------------- - -Whenever you need a reference to the entity manager inside one of -your controllers, views, or models you can do this: - -.. code-block:: php - - doctrine->em; - -That's all there is to it. Once you get the reference to your -EntityManager do your Doctrine 2.0 voodoo as normal. - -Note: If you do not choose to autoload the Doctrine library, you -will need to put this line before you get a reference to it: - -.. code-block:: php - - load->library('doctrine'); - -Good luck! - - diff --git a/docs/en/index.rst b/docs/en/index.rst index 4c50484e4a..0cea054dac 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -118,9 +118,6 @@ Cookbook :doc:`Entities in the Session ` | :doc:`Keeping your Modules independent ` -* **Integration into Frameworks/Libraries** - :doc:`CodeIgniter ` - * **Hidden Gems** :doc:`Prefixing Table Name ` diff --git a/docs/en/toc.rst b/docs/en/toc.rst index 0df70414f6..2309d56971 100644 --- a/docs/en/toc.rst +++ b/docs/en/toc.rst @@ -75,7 +75,6 @@ Cookbook cookbook/implementing-arrayaccess-for-domain-objects cookbook/implementing-the-notify-changetracking-policy cookbook/implementing-wakeup-or-clone - cookbook/integrating-with-codeigniter cookbook/resolve-target-entity-listener cookbook/sql-table-prefixes cookbook/strategy-cookbook-introduction