我一直在尝试这几个小时 – 我似乎无法找到任何有用的帖子.
我正在向Symfony2供应商目录添加自定义PHP类.
原文链接:https://www.f2er.com/php/137850.html我正在向Symfony2供应商目录添加自定义PHP类.
例如(复制其他供应商结构):
供应商/ MYLIB / MYLIB / SRC / MYLIB / LIB / Class.PHP
"require": { "mylib/mylib": "@dev" },
我还在vendor / mylib / mylib中创建了一个composer.json,其中包含:
{ "name": "mylib/mylib","type": "library","description": "My Libraty","keywords": ["library"],"autoload": { "psr-0": { "Mylib\\": "src/" } },"minimum-stability": "dev" }
namespace MyLib\Lib;
use MyLib\Lib\ClassName as ClassName; class Cms extends ClassName {}
我得到的错误是:
FatalErrorException: Error: Class ‘MyLib\Lib\MyClass’ not found in
C:\xampp\htdocs\My_CMS\src\Cms\CmsBundle\Entity\Cms.PHP line 13
我究竟做错了什么?