【发布时间】:2014-06-03 14:46:16
【问题描述】:
我是 Zend 和 Piwik. 的新手,我想在我的 ZF2 应用程序中使用 piwik library for zend。
但问题是piwik library for zend 是在 ZF1 中构建的,而我的应用程序是在 ZF2 中。
我已经检查了this 在 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'
),
)
));
}
}
那么有人可以帮我解决这个问题吗?
【问题讨论】:
标签: php zend-framework zend-framework2 matomo