We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Latest pHalcon, no loader->registerPrefixes and load of old code


Last year I'm busy with non IT projects.

Anyway today I start to new project, setup brand new Debian with latest pHalcon, point my last project, then

"PHP message: PHP Fatal error: Call to undefined method Phalcon\Loader::registerPrefixes() in /var/www/project/bootstrap.php "

My entire codebase configured around registerPrefixes and it seems it was removed (why ??) from phalcon 2.1

So I'm dead on water, is there any workaround

My best regards



you may implement that method in your own loader that extends Phalcon\loader

edited Apr '17

Yes, use namespaces. It was removed because it was deprecated.


Thanks, finally I put some custom autoloader function.

My editor does not autofind name spaces. SO every time I create a controller I have to have check tons of namespaces by manually. So I left using namespaces long ago. Probably I have change my editor but any way I'm old person (by programmer standards). I don't want to change too much in too small time.

However I do not understand why it was deprecated ?

edited Apr '17

Because prefixes loading is not efficient and also it was bad and old way to use it. Then i would suggest changing your editor for example to Visual Studio Code or even better to full IDE like PhpStorm.