Thursday, 15 September 2011

php - How to load the Zend Framework in my existing project? -



php - How to load the Zend Framework in my existing project? -

i'm trying add together zend existing project, , guess need autoloader. tried including various files in the loader folder , running register() method them;

require_once __dir__ . '/../../code/external/zend/library/zend/loader/moduleautoloader.php'; \zend\loader\moduleautoloader::register();

gets me:

php fatal error: uncaught exception 'logicexception' message 'passed array not specify existing static method (first array fellow member not valid class name or object)' in /home/kramer65/myproject/code/external/zend/library/zend/loader/moduleautoloader.php:312

and

require_once __dir__ . '/../../code/external/zend/library/zend/loader/standardautoloader.php'; \zend\loader\standardautoloader::register();

gets me:

php fatal error: uncaught exception 'logicexception' message 'passed array not specify existing static method (first array fellow member not valid class name or object)' in /home/kramer65/myproject/code/external/zend/library/zend/loader/standardautoloader.php:243

so checked out line 243 standardautoloader.php, reads:

spl_autoload_register(array($this, 'autoload'));

i guess need provide array, i'm unsure 1 , how? give me more appreciated guidance in how load zend in project? tips welcome!

[edit] allow me add together inquire zend 2.

you calling register() statically, not static method, cause of error. i've not done before, think want more this:

require_once __dir__ . '/../../code/external/zend/library/zend/loader/standardautoloader.php'; $loader = new zend\loader\standardautoloader(array('autoregister_zf' => true)); $loader->register();

php arrays zend-framework2 autoload

No comments:

Post a Comment