![]() |
CodeIgniter 2 and Doctrine 2 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: CodeIgniter 2 and Doctrine 2 (/showthread.php?tid=31853) |
CodeIgniter 2 and Doctrine 2 - El Forum - 07-04-2010 [eluser]Rui Lima[/eluser] Any good way to do this with a non-intrusive approach? I'm not able to find any tutorial with the version 2 of both api. CodeIgniter 2 and Doctrine 2 - El Forum - 07-06-2010 [eluser]Rui Lima[/eluser] I've found this: http://www.doctrine-project.org/projects/orm/2.0/docs/cookbook/integrating-with-codeigniter/en#integrating-with-codeigniter but got lost on: "Put the Doctrine folder (the one that contains Common, DBAL, and ORM) inside that same libraries folder." there is no folder that contains Common, DBAL and ORM ![]() CodeIgniter 2 and Doctrine 2 - El Forum - 07-07-2010 [eluser]Rui Lima[/eluser] I'm almost there... ![]() CodeIgniter 2 and Doctrine 2 - El Forum - 07-08-2010 [eluser]JiPi[/eluser] Is CI2 usable yet ? What stage of development is it currently ? We hadn't any news (on frontpage I mean) since the march... CodeIgniter 2 and Doctrine 2 - El Forum - 07-08-2010 [eluser]Rui Lima[/eluser] Yes! see here: http://ellislab.com/forums/viewreply/770721/ By the way, i think i've got it working CI2 + Doctrine 2, using a library as approach. Even have the CLI working. I'll post here HOW TO when i've some time. maybe in weekend. CodeIgniter 2 and Doctrine 2 - El Forum - 07-19-2010 [eluser]Deyan Yankov[/eluser] [quote author="Rui Lima" date="1278621520"]Yes! see here: http://ellislab.com/forums/viewreply/770721/ By the way, i think i've got it working CI2 + Doctrine 2, using a library as approach. Even have the CLI working. I'll post here HOW TO when i've some time. maybe in weekend.[/quote] Hello! Could you please post your Doctrine.php (the library configuration) file? I am banging my head ofr 3 days already to get Doctrine 2 working and nothing but headache (maybe also because of the death metal i'm listening too ![]() ![]() CodeIgniter 2 and Doctrine 2 - El Forum - 07-20-2010 [eluser]Rui Lima[/eluser] Hello, sorry! i've been a little sick this days. I will post the how to ASAP. CodeIgniter 2 and Doctrine 2 - El Forum - 07-28-2010 [eluser]Rui Lima[/eluser] first of all, sorry not being able to post this sooner. How to integrate CodeIgniter 2 and Doctrine 2 Here is my final folder structure: please see attachement 1.png You should take careful look at libraries and models. Inside libraries I have a Library called Doctrine.php and have 2 folders one to CLI and other to “Web”. Then inside models I have a folder called Entities. I want to have my own models, but this one will not access directly to DB, for them the DB are the Entities. In codeigniter what sould be done?! Code: $autoload['libraries'] = array('doctrine'); then confirm that inside DoctrineCLI\cli-config.php the database connection is the same as the codeigniter database.php. and that's all. i attach my files. i'm using xampp for windows, so hope you don't have any problems. i'm not a expert, but any problem/observation post it here. please get my forlder structure at: http://1e4411af.realfiles.net you will need 7ZIP CodeIgniter 2 and Doctrine 2 - El Forum - 09-04-2010 [eluser]subbu.genie[/eluser] Hey, First of all thanks a lot for the post. I tried something similar except that I dont have a CLI. The other thing to be noted is that Doctrine2 depends and works a lot on Namespaces which have come in PHP5.3. So while creating a model or referencing the same quoting them against their namespaces is very much required for Doctrine2. I would soon post a zip file of something I have done. Subbu CodeIgniter 2 and Doctrine 2 - El Forum - 09-13-2010 [eluser]Prophet[/eluser] Hi everyone. I've been trying to implement D2 with CI2 for the last few days. I'm still wrapping my head around the Doctrine ClassLoaders and PHP namespaces but I think I understand them well enough now. Here's a bit of what I've learned, just in case it helps somebody else. If you followed the Doctrine documentation when you set up your bootstrap file (application/libraries/Doctrine.php), you may have noticed the line: Code: $entitiesClassLoader = new ClassLoader('models', rtrim(APPPATH, '/' )); This tells Doctrine's ClassLoader to look in application/ (or so I thought) whenever you request a class from the models namespace. The thing that took me a while to work out is that it actually looks in application/models. So if you would like to create a User class, you need to create application/models/User.php and have it look something like this: Code: namespace models; You can then do something like $user = new models\User; I hope this helps somebody, because it took me a while to work out how to load classes like this. This way seems a bit more complicated then Doctrine 1.2 so maybe I'm not doing it properly? If that's the case, could somebody point me in the right direction ![]() |