Class loading method

@return   void
165819
protected function parseComposerJsonFiles ()
    {
        // First find all composer.json files that match pattern vendor-dev/*/*/composer.json
        $composerJsonFiles = array();

        $DirRoot = new \DirectoryIterator($this->rootPath);
        foreach ($DirRoot as $FileInRoot) {
            // Ignore non-directories
            if (!$FileInRoot->isDir()) {
                continue;
            }
            if ($FileInRoot->isDot()) {
                continue;
            }

            // Check if composer.json is present here - if so, do not recurse deeper
            $composerFile = $FileInRoot->getPathname() .'/composer.json';
            if (file_exists($composerFile)) {
                $composerJsonFiles[$composerFile] = $composerFile;
                continue;
            }

            $DirVendor = new \DirectoryIterator($FileInRoot->getPathname());
            foreach ($DirVendor as $FileInVendor) {
                // Ignore non-directories
                if (!$FileInVendor->isDir()) {
                    continue;
                }
                if ($FileInVendor->isDot()) {
                    continue;
                }

                $composerFile = $FileInVendor->getPathname() .'/composer.json';
                if (file_exists($composerFile)) {
                    $composerJsonFiles[$composerFile] = $composerFile;
                }
            }
        }

        // Sort by path to get predictable results
        ksort($composerJsonFiles);

        // Now parse all composer.jsons and extract namespace information
        foreach ($composerJsonFiles as $cjfPath) {
            $cjf = json_decode(file_get_contents($cjfPath), true);

            // Signal invalid json
            if (NULL === $cjf) {
                throw new \Exception("Unparseable composer.json file: '$cjfPath'");
            }

            // Skip if no autoload or no psr-4 section is present
            if (!isset($cjf['autoload'])) {
                continue;
            }
            if (!isset($cjf['autoload']['psr-4'])) {
                continue;
            }

            foreach ($cjf['autoload']['psr-4'] as $namespace => $relPath) {
                $absPath = dirname($cjfPath) .'/'. $relPath;

                // Do not allow overlapping namespaces for now
                if (isset($this->nsData[$namespace])) {
                    throw new \Exception("VendorDevLoader error: duplicate namespace definition. First instance defined in '". $this->namespace2path[$namespace]["composerJsonPath"] ."', second instance found in '$cjfPath'");
                }

                $this->nsData[$namespace] = array(
                    'namespace'        => $namespace,
                    'relPath'          => $relPath,
                    'absPath'          => $absPath,
                    'composerJsonPath' => $cjfPath,
                );
            }
        }

        // Now reverse sort it, so that the most specific namespace definition gets evaluated first
        krsort($this->nsData);
    }
1359299
public function autoload($class) {
        $classKey = strtolower($class);

        if (isset($this->classes[$classKey])) {
            list($_, $path) = $this->classes[$classKey];
            include_once $path;
        }
    }
1233096
private function load()
    {
        $decoder = new JsonDecoder();
        $decoder->setObjectDecoding(JsonDecoder::ASSOC_ARRAY);

        $this->json = file_exists($this->path)
            ? $decoder->decodeFile($this->path)
            : array();

        if (!isset($this->json['keysByTypeName'])) {
            $this->json['keysByTypeName'] = array();
            $this->json['typesByKey'] = array();
            $this->json['bindingsByKey'] = array();
            $this->json['nextKey'] = 0;
        }
    }
693023
private function Load()
	{
		$sql = "show tables";
		$rs = $this->Server->Connection->Select($sql);
		
		// first pass load all the tables.  this will initialize each object.  we have to
		// do this first so that we can correctly determine and store "Set" information
		while ($row = $this->Server->Connection->Next($rs))
		{
			$this->Tables[$row["Tables_in_" . $this->Name]] = new DBTable($this,$row);
		}
		
		// now load all the keys and constraints for each table
		foreach ($this->Tables as $table)
		{
			$table->LoadKeys();
		}

		$this->Server->Connection->Release($rs);
		
		$sql = "show table status from `" . $this->Name . "`";
		$rs2 = $this->Server->Connection->Select($sql);
		
		// load the extra data
		while ($row = $this->Server->Connection->Next($rs2))
		{
			$this->Tables[$row["Name"]]->Engine = $row["Engine"]; 
			$this->Tables[$row["Name"]]->Comment = $row["Comment"];
		}
		$this->Server->Connection->Release($rs2);
	}
899178
protected function forcePhpConsoleClassesAutoLoad() {
		foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__), \RecursiveIteratorIterator::LEAVES_ONLY) as $path) {
			/** @var $path \SplFileInfo */
			if($path->isFile() && $path->getExtension() == 'php' && $path->getFilename() !== 'PsrLogger.php') {
				require_once($path->getPathname());
			}
		}
	}
1350428
public function autoload($className)
	{
	    $className = ltrim($className, '\\');
	    $fileName  = '';
	    $namespace = '';
	    if ($lastNsPos = strrpos($className, '\\')) {
	        $namespace = substr($className, 0, $lastNsPos);
	        $className = substr($className, $lastNsPos + 1);
	        $fileName  = str_replace('\\', DIRECTORY_SEPARATOR, dirname(__FILE__). DIRECTORY_SEPARATOR . $namespace) . DIRECTORY_SEPARATOR;
	    }
	    $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
	    if(file_exists($fileName))
    		require $fileName;    		
	}
371209
private static function init(): void
    {
        if (static::$initialized === false) {
            $baseClass = Base::getInstance();

            static::$initialized = true;
            static::$logDir = $baseClass->parsePath((string)$baseClass->Log->logDirectory);
            static::$classConfig = $baseClass->Log->classConfig->toArray();

            if (static::$logDir != '') {
                Directory::create(static::$logDir);
            }
        }
    }
722135
public function bootstrap()
    {

        // setup autoloader
        require SERVER_AUTOLOADER;

        // make the application available and register the class loaders
        $application = $this->getApplication();
        $application->registerClassLoaders();

        // register the applications annotation registries
        $application->registerAnnotationRegistries();

        // try to load the profile logger
        if (isset($this->loggers[LoggerUtils::PROFILE])) {
            $this->profileLogger = $this->loggers[LoggerUtils::PROFILE];
            $this->profileLogger->appendThreadContext('timer-factory');
        }
    }
1344122
protected function initialize() {
		foreach ( $this->apply_filters( 'filter', $this->app->config->load( 'filter' ) ) as $class => $tags ) {
			$this->register_class_filter( $class, $tags );
		}
	}
381699
protected function load()
    {
        if ($this->loaded)
        {
            return;
        }
        $plugin = Eresus_Plugin_Registry::getInstance()->load('gallery');
        /* @var Gallery_Entity_Table_Image $table */
        $table = ORM::getTable($plugin, 'Image');
        $this->items = $table->findInSection($this->sectionId, null, null, true);
        $this->loaded = true;
    }
359598
protected function load()
	{
		$this->rules = [];
		$rules = DiscHelper::loadFromFile($this->ruleFile);
		foreach ($rules as $name => $ruleData) {
			$this->rules[$name] = unserialize($ruleData);
		}
	}
27772
public function load() {
		session_start();

		$this->loadSiteClass();
		$this->checkRedirect();
		$this->applyViewRenderer();

		$this->loadController();
		$this->render();

	}
1210550
protected function load()
    {
        $tables = $this->fetchTables($this->schema);
        foreach ($tables as $table) {
            $blueprint = new Blueprint($this->connection->getName(), $this->schema, $table);
            $this->fillColumns($blueprint);
            $this->fillConstraints($blueprint);
            $this->tables[$table] = $blueprint;
        }
    }
441267
public function load() {
        if ($this->_loaded) return;
        $factory = HTMLPurifier_LanguageFactory::instance();
        $factory->loadLanguage($this->code);
        foreach ($factory->keys as $key) {
            $this->$key = $factory->cache[$this->code][$key];
        }
        $this->_loaded = true;
    }
879527
public function postLoad()
    {
        // Ensure class content are known
        $data = (array) $this->_data;
        foreach ($data as $dataEntry) {
            $type = key($dataEntry);

            $dataEntry = array_pop($dataEntry);
            if (true === is_array($dataEntry)) {
                $type = key($dataEntry);
            }

            if ($type !== 'scalar' && $type !== 'array') {
                self::getFullClassname($type);
            }
        }

        parent::postLoad();
    }
949322
private static function bootClass()
    {
        if (!array_key_exists(static::class, self::$meta)) {
            self::$meta[static::class] = (new \ReflectionClass(static::class))->getConstants();
            unset(self::$meta[static::class]['__default']);

            if (method_exists(static::class, 'boot')) {
                static::boot();
            }
        }
    }
316521
protected function loadModule() : void
    {
        $fqn = $this->getFullyQualifiedClass($this->response->getModule(), $this->response->getController());
        $the_module = new $fqn();
        call_user_func_array(array($the_module, $this->getActionMethodName($this->response->getAction())), [$this->response->getVariables()]);
    }