I want to use the Zend_Dom_Query class, but I don’t need anything else from the Zend Framework
I have Zend in a folder at library/Zend
Then I do the following:
require_once 'library/Zend/Dom/Query.php';
$dom = new Zend_Dom_Query($html);
This results in the error:
Fatal error: Class ‘Zend_Dom_Query’ not found in
/Users/jimmytidey/projects/think_tank_bank/html/people/demos.php on
line 9
So far as I can tell this to do with autoloading to give zend a namespace to run in. No matter how I try, I cannot configure autoloading to work. I’m not familiar especially with namespaces in PHP.
I have solved this problem, though I don’t fully understand how.
Zend Autoloading is aimed at solving the problem of having lots of includes throughout your code, optimising file inclusion to run as quickly as possible, and at solving the include problem for third party dependencies you have.
All the examples I’ve found demonstrate all these complex features, here is the missing simplest case example (with all zend code now moved from the library folder as in the original question and relocated to the root).
That’s it – all you need.