使用zend Framework 2/3组件的外部zf应用程序 [英] use zend framework 2/3 component's outside zf app
本文介绍了使用zend Framework 2/3组件的外部zf应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用zend框架之外的某些zend框架组件,但是我无法这样做.
I am trying to use some zend framework components outside of zend framework but I am unable to do so.
这是我的作曲家文件.
{
"require": {
"zendframework/zend-authentication": "^2.5.3"
},
"autoload": {
"psr-4": {
"Zend\\Authentication\\": ""
}
}
}
我能够运行composer更新并进行安装,从而生成了autoload.php.
I was able to run composer update and install which has generated the autoload.php.
但是当我尝试使用该组件时,出现致命错误:找不到类'Zend \ Authentication \ Storage \ Session'"
But when I try to use a the component I get "Fatal error: Class 'Zend\Authentication\Storage\Session' not found"
$session = new \Zend\Authentication\Storage\Session();
设置中是否有明显的我想念的东西?
Is there anything obvious that I am missing from my setup?
推荐答案
我需要自动装带器
require __DIR__ . '/../vendor/autoload.php';
问题现在已解决
这篇关于使用zend Framework 2/3组件的外部zf应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文