나는 다음과 같은 공급 업체의 디렉토리 구조와 PHP 프로젝트가 : 나는 autoload_namespaces.php의 everythins에 다음 줄을 넣어젠드 프레임 워크 작곡가 자동로드
vendor
zendframework
zendframework
library
Zend
...
...
Cache
...
...
괜찮 :
'Zend\\Cache' => $vendorDir . '/zendframework/zendframework/library/',
을하지만,이 라인은 아무튼 't 작업 :
'Zend\\Cache' => $vendorDir . '/zendframework/zendframework/library/Zend/Cache/',
오류 :
Fatal error: Class 'Zend\Cache\Storage\Adapter\MemcachedOptions' not found
내 코드에 어떤 문제가 있습니까? zend 프레임 워크에서 캐시 모듈 만로드하려면 어떻게해야합니까? 전체 라이브러리 폴더를 지정하면 왜 작동합니까?
당신이 뭘 하려는지를? 클래스는 필요에 따라로드되며 응용 프로그램은 사용되는 클래스 만로드합니다. 'autoload_namespaces.php' 파일은 Composer에 의해 자동으로 생성되므로 편집해서는 안됩니다. –
MemcachedOptions() 클래스를 사용하려고합니다 :'$ options = new \ Zend \ Cache \ Storage \ Adapter \ MemcachedOptions();'그리고이 줄은 에러를 발생시킵니다. – Phantom
Composer를 사용하여 젠드 프레임 워크를 설치했다면'autoload_namespaces.php'에'Zend \\'항목이 있어야합니다. 그게 당신이 원하는 전부입니다. 다른 것을 바꾸지 마십시오. 없으면 Composer를 사용하여 ZF를 다시 설치하십시오. –