Understanding Autoloading and Namespaces in PHP

Started by hsing, February 23, 2024, 08:29:43 AM

Previous topic - Next topic
Hi everyone,

I have a question regarding namespaces. I understand that using namespace Vendor\Model; and use Vendor\Model; with autoloading can greatly simplify the code. However, I want to comprehend how this entire process works. I previously saw files like Autoload/Loader.php, Di/Di.php in the /usr/local/opnsense/mvc/app/library/OPNsense/Phalcon/ directory, but they have been removed. Additionally, in the /usr/local/opnsense/mvc/app/config directory, I can still see the use of use Phalcon\MVC, use Phalcon\Di. Could anyone provide some advice or references regarding these issues? Thank you.