I’m using the Zend Framework 2.0 to autoload Zend classes in my application, independent of an MVC framework.
The location of the zend framework, is C:/wamp/library/zendframework/library (contains Zend/Soap etc.)
Below is my code:
require_once 'Zend/Loader/StandardAutoloader.php';
$loader = new Zend\Loader\StandardAutoloader(array(
'Zend' => 'c:/wamp/library/zendframework/library'));
$loader = new Zend\Loader\StandardAutoloader();
$loader->registerNamespace('Zend', 'c:/wamp/library/zendframework/library');
$loader->register();
$auto = new Zend/Soap/Server(null,null);
$auto->setClass('services');
$auto->handle();
I’m trying to load the Zend/Soap/Server, but I keep getting the error:
Fatal error: Class 'Zend' not found in C:\wamp\www\Zend_soap\server.php on line 42
whereby on line 42:
$auto = new Zend/Soap/Server(null,null);
very close, I think;
If your ZF2 installation is on the php include_path you should only need 3 lines of code and 4 if it;s not on the include_path.
Good Luck! I hope this helped.