OPNsense Forum

English Forums => Development and Code Review => Topic started by: hsing on February 23, 2024, 08:29:43 AM

Title: Understanding Autoloading and Namespaces in PHP
Post by: hsing on February 23, 2024, 08:29:43 AM
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.