I am currently trying to run Doctrine in a custom (own) project, which isn't based on any popular framework.
I've been able to do the following for my current bootstrap.php;
<?php
require dirname(__FILE__) . '/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine', dirname(__FILE__) );
$classLoader->register(); // register on SPL autoload stack
However I have a strong feeling that this is far from enough and I can't find any documentation which clearly states what I should do next.
Running $conn = Doctrine_Manager::connection('mysql://root:[email protected]/myTable', 'doctrine');
will make my PHP file to start throwing errors (Fatal error: Class 'Doctrine_Manager' not found) - so I am pretty sure that I have not completed the bootstrap.php properly.
What should I do to make Doctrine run as intended in my own project?
If you work your way through extensive doctrine documentation on the project website, it walks you through step by step what's required for a proper doctrine bootstrap
Added from comment on question
I'm fairly certain there is no Doctrine_Manager in Doctrine 2. There's an EntityManager. Doctrine_Manager::connection('mysql://root:[email protected]/myTable', 'doctrine');
this is Doctrine 1 code.
Either way, all classes should be namespaced \Doctrine_Manager
Here are some good reference for you:
Doctrine 1 to Doctrine 2
Doctrine 2 - Not the same old PHP ORM Slide 44 is what you are after
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With