I am having trouble implementing a particular class in PHP. I want to use Anthony Ferrara's RandomLib library in my Zend Framework application (you can find it here.)
I've been programming in PHP for a few years now, so I know my way around it for the most part. But I have to admit that I'm kind of clueless when it comes to using classes that implement namespaces. Here's what I've got in my code:
public static function generateToken()
{
require_once 'RandomLib/Factory.php';
$factory = new \RandomLib\Factory;
$generator = $factory->getMediumStrengthGenerator();
return $generator->generate(16);
}
Unfortunately, I'm getting the following error:
Fatal error: Class 'SecurityLib\AbstractFactory' not found in C:\xampp\php\includes\RandomLib\Factory.php on line 30
Like I said, I really have no idea what's going on here. I don't know if I'm supposed to use some kind of use statement in my class or not.