我是Zend的新手,也是皮维克。的新手,我想在我的ZF2应用程序中使用zend的piwik库。
但问题是,zend的piwik库是在ZF1中构建的,而我的应用程序是在ZF2中构建的。
我已经检查了这解决方案,以便在ZF2中使用ZF1库,但它并不适用于我。
我的init_autoloader.php在if($zf2Path){ statement:中略有不同
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,
)
));
}
}我像这样改变了init_autoloader.php的一部分if($zf2Path){ statement:
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'
),
)
));
}
}有人能帮我吗?
发布于 2014-08-05 13:43:39
这里有一个ZendFramework2集成:https://github.com/heiglandreas/piwik
https://stackoverflow.com/questions/24018209
复制相似问题