Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在zendframework 2中使用zendframework 1库_Php_Zend Framework_Zend Framework2_Matomo - Fatal编程技术网

Php 在zendframework 2中使用zendframework 1库

Php 在zendframework 2中使用zendframework 1库,php,zend-framework,zend-framework2,matomo,Php,Zend Framework,Zend Framework2,Matomo,我是Zend的新手,也是我想在ZF2应用程序中使用的新手 但问题是ZF1内置了,而我的应用程序是在ZF2中 我有在ZF2中使用ZF1库的检查解决方案,但它不适合我 在if($zf2Path){语句: if ($zf2Path && !class_exists('Zend\Loader\AutoloaderFactory')) { if (isset($loader)) { $loader->add('Zend', $zf2Path);

我是Zend的新手,也是我想在ZF2应用程序中使用的新手

但问题是ZF1内置了,而我的应用程序是在ZF2中

我有在ZF2中使用ZF1库的检查解决方案,但它不适合我

if($zf2Path){语句:

if ($zf2Path && !class_exists('Zend\Loader\AutoloaderFactory')) {
    if (isset($loader)) {
        $loader->add('Zend', $zf2Path);
        $loader->add('ZendXml', $zf2Path);      
    } else {
        include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
        Zend\Loader\AutoloaderFactory::factory(array(
            'Zend\Loader\StandardAutoloader' => array(
                'autoregister_zf' => true,
            )
        ));
    }
}
我已经改变了
if($zf2Path){语句:
init_autoloader.php的一部分,如下所示

if ($zf2Path && !class_exists('Zend\Loader\AutoloaderFactory')) {
    if (isset($loader)) {
        $loader->add('Zend', $zf2Path);
        $loader->add('ZendXml', $zf2Path);
    } else {
        include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';

        set_include_path(implode(PATH_SEPARATOR, array($zf1Path, get_include_path())));
        Zend\Loader\AutoloaderFactory::factory(array(
            'Zend\Loader\StandardAutoloader' => array(
                'autoregister_zf' => true,
                'prefixes' => array(
                    'Zend_' => $zf1Path . '/Zend'
                ),
            )
        ));
    }
}

有人能帮我吗?

这里有一个Zend Framework 2集成: