我在
PHP中实现特定的类时遇到了麻烦.我想在我的Zend Framework应用程序中使用Anthony Ferrara的RandomLib库(你可以找到它
here.)
我已经用PHP编程了几年了,所以我大部分都知道我的方法.但我必须承认,在使用实现名称空间的类时,我有点无能为力.这是我在我的代码中得到的:
public static function generateToken()
{
require_once 'RandomLib/Factory.php';
$factory = new \RandomLib\Factory;
$generator = $factory->getMediumStrengthGenerator();
return $generator->generate(16);
}
不幸的是,我收到以下错误:
Fatal error: Class 'SecurityLib\AbstractFactory' not found in C:\xampp\php\includes\RandomLib\Factory.php on line 30
就像我说的,我真的不知道这里发生了什么.我不知道我是否应该在课堂上使用某种使用声明.