src/Common/Controller/Base.php
protected function definePackages()
    {
        /**
         * This is an important part. Here we are defining all the packages to load.
         * this translates as "where CodeIgniter will look for stuff".
         *
         * We have to do a few manual hacks to ensure things work as expected, i.e.
         * the load/check order is:
         *
         * 1. The Application
         * 2. Available modules
         * 3. Nails Common
         */

        //  Reset
        $oConfig                = Factory::service('Config');
        $oConfig->_config_paths = [];

        $aPaths = [];

        //  Nails Common
        $aPaths[] = NAILS_COMMON_PATH;

        //  Available Modules
        $aAvailableModules = Components::modules();

        foreach ($aAvailableModules as $oModule) {
            $aPaths[] = $oModule->path;
        }

        //  The Application
        $aPaths[] = NAILS_APP_PATH . 'application';

        foreach ($aPaths as $sPath) {
            $this->load->add_package_path($sPath);
        }
    }
protected function definePackages()
    {
        /**
         * This is an important part. Here we are defining all the packages to load.
         * this translates as "where CodeIgniter will look for stuff".
         *
         * We have to do a few manual hacks to ensure things work as expected, i.e.
         * the load/check order is:
         *
         * 1. The Application
         * 2. Available modules
         * 3. Nails Common
         */

        //  Reset
        $oConfig                = Factory::service('Config');
        $oConfig->_config_paths = [];

        $aPaths = [];

        //  Nails Common
        $aPaths[] = NAILS_COMMON_PATH;

        //  Available Modules
        $aAvailableModules = Components::modules();

        foreach ($aAvailableModules as $oModule) {
            $aPaths[] = $oModule->path;
        }

        //  The Application
        $aPaths[] = NAILS_APP_PATH . 'application';

        foreach ($aPaths as $sPath) {
            $this->load->add_package_path($sPath);
        }
    }
protected function definePackages ( ) { /**
         * This is an important part. Here we are defining all the packages to load.
         * this translates as "where CodeIgniter will look for stuff".
         *
         * We have to do a few manual hacks to ensure things work as expected, i.e.
         * the load/check order is:
         *
         * 1. The Application
         * 2. Available modules
         * 3. Nails Common
         */ //  Reset $ oConfig = Factory :: service ( 'Config' ) ; $ oConfig -> _config_paths = [ ] ; $ aPaths = [ ] ; //  Nails Common $ aPaths [ ] = NAILS_COMMON_PATH ; //  Available Modules $ aAvailableModules = Components :: modules ( ) ; foreach ( $ aAvailableModules as $ oModule ) { $ aPaths [ ] = $ oModule -> path ; } //  The Application $ aPaths [ ] = NAILS_APP_PATH . 'application' ; foreach ( $ aPaths as $ sPath ) { $ this -> load -> add_package_path ( $ sPath ) ; } }
Defines all the package paths
Defines all the package paths