我正在做一个 Symfony2 项目。对于有用的技术实践,我需要导入外部库。所以我做到了。但是这个库创建了一些从 Exception 扩展的 *_Exception 类。
我的外部库文件以:
class CloudKey_Exception extends Exception {}
class CloudKey_RPCException extends CloudKey_Exception {public $data = null;}
class CloudKey_ProcessorException extends CloudKey_RPCException {}
class CloudKey_TransportException extends CloudKey_RPCException {}
class CloudKey_SerializerException extends CloudKey_RPCException {}
class CloudKey_AuthenticationErrorException extends CloudKey_RPCException {}
class CloudKey_RateLimitExceededException extends CloudKey_AuthenticationErrorException {}
class CloudKey_InvalidRequestException extends CloudKey_RPCException {}
class CloudKey_InvalidObjectException extends CloudKey_InvalidRequestException {}
class CloudKey_InvalidMethodException extends CloudKey_InvalidRequestException {}
class CloudKey_InvalidParamException extends CloudKey_InvalidRequestException {}
class CloudKey_ApplicationException extends CloudKey_RPCException {}
class CloudKey_NotFoundException extends CloudKey_ApplicationException {}
class CloudKey_ExistsException extends CloudKey_ApplicationException {}
class CloudKey_LimitExceededException extends CloudKey_ApplicationException {}
当我尝试在控制器中实例化我的对象时,Symfony 会返回:
致命错误:在第 513 行的 /var/www/carpediese/src/CD/DMBundle/Entity/CloudKey.php 中找不到类“CD\DMBundle\Entity\Exception”
我认为异常类是原生 PHP5+ 类。我怎样才能告诉 Symfony?