sorry, Rick, I could not make it work… Could you please take a look what I did wrong?
Here are my steps,
1)Download doctrine into a folder called “Doctrine”;
2)Write a script with following codes,
require_once(‘Doctrine/lib/Doctrine.php’);
spl_autoload_register(array(‘Doctrine’, ‘autoload’));
Doctrine_Manager::connection(‘mysql://user:password@localhost/project1’);
Doctrine::generateModelsFromDb(‘myModel’);
3)After running this script, I got myModel folder, which has a generated folder and Student.php (from my database)
4)Then I compiled doctrine by this script,
require_once(‘Doctrine/lib/Doctrine.php’);
spl_autoload_register(array(‘Doctrine’, ‘autoload’));
Doctrine::compile();
5) And I saw a new file Doctrine.compiled in the lib folder.
6) Now I try to create a new file to test, here is the code,
require_once(‘Doctrine/lib/Doctrine.compiled.php’);
require_once(‘myModel/Student.php’);
echo “include success”;
When I run this code, it did not print out “include success”. What did I do wrong?
If I comment out require_once(‘myModel/Student.php’), it will print out.
Thanks for all your help.