Hi I'm having hard time with namespace in models inside a CLI application :
$loader = new \Phalcon\Loader();
$loader->registerNamespaces(array(
'Tuango\CLI\Task' => APPLICATION_PATH . '/tasks',
'Tuango\CLI\Security' => APPLICATION_PATH . '/lib/Tuango/CLI/Security/',
'Tuango\Models' => APPLICATION_PATH . '/models/Tuango/Models/'
));
$loader->registerDirs(
array(
//APPLICATION_PATH . '/tasks',
//APPLICATION_PATH . '/models'
)
);
$loader->register();
Parent class :
namespace Tuango\CLI\Security;
abstract class Fraud {
//Abstract stuff here
}
Child class :
namespace Tuango\CLI\Security;
use Tuango\CLI\Security\Fraud;
class LiveFraud extends Fraud {
//Class stuff and abstract method inherited
}
Task :
namespace Tuango\CLI\Task;
use Tuango\CLI\Security\LiveFraud;
class FraudTask extends \Phalcon\CLI\Task {
public function mainAction() {
$liveFraud = new LiveFraud();
$liveFraud->execute();
}
}
Fatal error: Class 'Tuango\CLI\Security\Fraud' not found in /Library/WebServer/Documents/tuangocli/app/lib/Tuango/CLI/Security/LiveFraud.php on line 30
I can't figure out what's the problem here.
Any help would be appreciated :)
Thank you.