Autoload custom module files.

@param array $module

@return void
492632
private function autoloadFiles($module)
    {
        if (isset($module['autoload'])) {
            foreach ($module['autoload'] as $file) {
                $path = module_path($module['slug'], $file);

                if (file_exists($path)) {
                    include $path;
                }
            }
        }
    }
888516
public static function init(array $mcaName, array $modules): void
    {
        self::$mcaName = $mcaName;
        self::$modules = $modules;
    }
494116
private function initialize()
    {

        if (is_file($file = getcwd().'/vendor/autoload.php')) {
            include_once $file;
        }
        $functions = spl_autoload_functions();
        foreach ($functions as $loader) {
            if (is_array($loader)) {
                $ob = $loader[0];
                if (is_object($ob)) {
                    $this->addAutoloader($ob);
                }
            }
        }
    }
472822
protected function autoload()
    {
        if ($this->loaded) {
            return;
        }

        $table = Common::prefixTable('option');
        $sql   = 'SELECT option_value, option_name FROM `' . $table . '` WHERE autoload = 1';
        $all   = Db::fetchAll($sql);

        foreach ($all as $option) {
            $this->all[$option['option_name']] = $option['option_value'];
        }

        $this->loaded = true;
    }
167565
async function loadModulesConfig()
{
    if(!modulesLoaded)
    {
		for (let i = 0; i < modules.length; i++) {
			await applyBotDataSource(modules[i]);
        }
        
        modulesLoaded = true;
    }
}
1011439
public function autoload(array $paths = [])
    {
        if (empty($paths)) {
            return;
        }
        spl_autoload_register(function (string $class) use ($paths) {

            $file = DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';

            foreach ($paths as $path) {
                if (is_file($path . $file)) {
                    include($path . $file);
                    return true;
                }
            }
            return false;
        });
    }
879839
public function registerModules(string $filePath = null)
    {
        is_file($filePath) || $filePath = App::getBasePath() . $filePath;

        if (is_file($filePath)) {
            /** @var Registry $modules */

            /** @noinspection PhpIncludeInspection */
            $modules = require_once $filePath;

            $modules = is_array($modules) ? $modules : [];

            foreach ($modules as $module) {
                IOC::resolve('Modules')->register($module);
            }

            Event::dispatch('minimal.loaded.modules', [$filePath, $modules]);
        }
    }
62810
public function setModules(array $modules)
    {
        $this->modules = array();

        foreach ($modules as $module) {
            $this->addModule($module);
        }

        return $this;
    }
357412
public function autoloadPlugins()
    {
        foreach(self::activePlugins() as $plugin){
            // plugin composer autoload
            if(File::exists($plugin->basePath().'/vendor/autoload.php')) {
                include $plugin->basePath() . '/vendor/autoload.php';
            }
            // plugin helpers
            if(File::exists($plugin->basePath().'/support/helpers.php')) {
                include $plugin->basePath() . '/support/helpers.php';
            }
        }
        return;
    }
1206287
protected function setModuleMigrationPaths($module)
    {
        $paths = [Yii::getAlias('@app/runtime/tmp')];
        if (isset($this->allMigrationPaths[$module])) {
            $paths[$module] = $this->allMigrationPaths[$module];
        }
        $this->allMigrationPaths = $paths;
        $this->setMigrationFiles();
    }
489901
public function run($module)
    {
        $moduleSettings = $module->getInfo('settings');
        $isTheme = $this->isTheme($module->getId());
        if (!$isTheme || ($isTheme && is_array($moduleSettings))) {
            $this->addModuleSettings($moduleSettings, $module->getId());
        }
    }
417721
private function loadBoot($module) {

		if(false === is_string($module)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($module)), E_USER_ERROR);
		}
		
		$boot = Path :: get('modules') . $module . DIRECTORY_SEPARATOR . Files :: get('boot');

		if(true === is_readable($boot)) {
			require_once($boot);
		}
	}
1365272
public static function autoload()
    {
        // Vendor path
        $dir_base = realpath(__DIR__ . '/../../../../');

        $finder = new Finder();
        $finder->files()
            ->ignoreVCS(true)
            ->ignoreDotFiles(false)
            ->name('service.yml')
            ->exclude('Tests')
            ->exclude('tests')
            ->in($dir_base);

        foreach ($finder as $file) {
            self::autoloadFile($file);
        }
    }
751752
protected function __autoload($className)
	{
		// Single modules autoload

		foreach ($this->config('defaultAutoloads') as $key => $dir)
		{
			$fileName = $dir . DIRECTORY_SEPARATOR . $className . '.php';
			$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $fileName);

			if (file_exists($fileName) && !class_exists($className))
			{
				$this->loadFiles[$className] = $fileName;

				require $fileName;
			}
		}

		// Multi-Modules autoload

		$modules = array_merge([], $this->config('modules'));

		foreach ($modules as $key => $module)
		{
			$module = ($module == '') ? $module : $module . DIRECTORY_SEPARATOR;

			foreach ($this->config('mvcDirs') as $k => $mvc)
			{
                $phpFile  = explode("\\", $className);
                $phpFile  = $phpFile[count($phpFile) - 1];
				$fileName = $this->path . str_replace('\\', DIRECTORY_SEPARATOR, strtolower(str_replace($phpFile, '', $className))). $phpFile . '.php';

				if (file_exists($fileName) && !class_exists($className))
				{
					$this->loadFiles[$className] = $fileName;

					require $fileName;
				}
			}
		}

		// User custom autoloads

		foreach ($this->config('autoloads') as $key => $dir)
		{
			$fileName = realpath($dir) . DIRECTORY_SEPARATOR . $className . '.php';
			$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $fileName);

			if (file_exists($fileName) && !class_exists($className))
			{
				$this->loadFiles[$className] = $fileName;

				require $fileName;
			}
		}
	}
746110
public static function add_module( $module ) {
		if ( ! in_array( $module, self::$modules, true ) ) {
			self::$modules[] = $module;
		}
	}
919490
public function setModule($module) {
        if (!is_string($module) || empty($module)) {
            $errMessage = "The module value must be a string and not be empty";
            throw new \InvalidArgumentException($errMessage, GeneralErrors::VALUE_IS_NOT_OF_EXPECTED_TYPE);
        }

        $this->module = $module;
    }
1246877
private function loadRequiredModules(
		Module $module,
		&$modules,
		array $moduleList,
		DependencyInjectionContainer $dic) {
		foreach ($module->getRequiredModules() as $requiredModule) {
			if (!\in_array($requiredModule, $moduleList)) {
				$this->loadModule($requiredModule, $modules, $moduleList, $dic);
				if ($module instanceof RequiredModuleAwareModule) {
					$module->addRequiredModule($dic->make($requiredModule));
				}
			}
		}
	}