use auto-loading for PHP-classes of restler-framework and extBase/TYPO3 (use dependency-injection of extBase)
506128
private function setAutoLoading()
    {
        // set auto-loading for restler
        $autoload = PATH_site . 'typo3conf/ext/restler/vendor/autoload.php';
        if (file_exists($autoload)) {
            require_once $autoload;
        }

        // set auto-loading for extBase/TYPO3-classes
        $objectManager = $this->objectManager;
        Scope::$resolver = function ($className) use ($objectManager) {
            return $objectManager->get($className);
        };
    }
97271
private function loadResources()
    {
        if ($this->class !== null && $this->classFilterSet === false) {
            $this->addClassFilter();
        }

        /** @var common_persistence_SqlPersistence $persistence */
        $persistence = $this->getModel()->getPersistence();
        $platform = $persistence->getPlatForm();
        $query = $platform->getQueryBuilder()
            ->select('*')
            ->from('statements')
            ->andWhere('id > ' . $this->lastId)
            ->orderBy('id');

        if ($this->cacheSize > 0) {
            $query->setMaxResults($this->cacheSize);
        }

        $query = $this->filter->applyFilters($query);
        $results = $query->execute();

        if ($this->cacheSize > 0) {
            $this->endOfClass = $results->rowCount() < $this->cacheSize;
        }

        foreach ($results->fetchAll() as $result) {
            $this->resources[] = $result;
            $this->lastId = $result['id'] > $this->lastId ? $result['id'] : $this->lastId;
        }
    }
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);
                }
            }
        }
    }
797603
protected function requireDependencies()
    {
        if (!empty($this->pharLocation)) {
            include_once 'phar://' . $this->pharLocation . '/vendor/autoload.php';
        }

        // check 2.x version (composer/phar)
        if (class_exists('PDepend\\TextUI\\Runner')) {
            return;
        }

        $this->oldVersion = true;

        // check 1.x version (composer)
        if (class_exists('PHP_Depend_TextUI_Runner')) {
            // include_path hack for PHP_Depend 1.1.3
            $rc = new ReflectionClass('PHP_Depend');
            set_include_path(get_include_path() . ":" . realpath(dirname($rc->getFileName()) . "/../"));

            return;
        }

        @include_once 'PHP/Depend/Autoload.php';

        if (!class_exists('PHP_Depend_Autoload')) {
            throw new BuildException(
                'PhpDependTask depends on PHP_Depend being installed and on include_path',
                $this->getLocation()
            );
        }

        // register PHP_Depend autoloader
        $autoload = new PHP_Depend_Autoload();
        $autoload->register();
    }
1319473
protected function autoloadJS()
	{
		if (!is_string($this->callback))
		{
			return;
		}

		try
		{
			$this->js = FunctionProvider::get($this->callback);
		}
		catch (InvalidArgumentException $e)
		{
			// Do nothing
		}
	}
1349051
static function load_obj($classToLoad) {
		$pathExploded = explode('\\', $classToLoad);
		
		if(reset($pathExploded) == 'SimplOn') {
			$file_to_load = '../' . str_replace('\\', '/', $classToLoad) . '.php';
			if(file_exists($file_to_load)) {
				require $file_to_load;
				return true;
			}
		} else {
			$classToLoad = end($pathExploded);
			
			$test = array(
				self::$LOCAL_ROOT,
				self::$GENERIC_TEMPLATES_PATH,
				self::$SimplOn_PATH,
			);
		
			foreach($test as $base) {
				foreach(self::$AUTOLOAD_DIRS as &$type) {
					$file_to_load = $base.DIRECTORY_SEPARATOR.$type.DIRECTORY_SEPARATOR.$classToLoad.'.php';
					
					if( file_exists($file_to_load) ) {
						//echo $file_to_load.'<br>';
						require_once $file_to_load;
						return true;
					}
				}
			}
		}
		return false;
		//throw new \Exception("Can't find the file: $classToLoad.php");
	}
1198915
public function auto_load() {
		/**
		 * do UI loader locations
		 *
		 * @param ui $this Current instance of this class
		 */
		do_action( 'uix_register', $this );
		// init the share object
		uix_share();

		// go over each locations
		foreach ( $this->locations as $type => $paths ) {

			if ( $this->is_callable( $type ) ) {
				$this->process_paths( $type, $paths );
			}
		}
	}
603798
final public static function autoload($class)
    {
        if (version_compare(PHP_VERSION, '5.3', '>=') && __NAMESPACE__) {
            $class = str_replace(__NAMESPACE__, 'PHPTAL', $class);
            $class = strtr($class, '\\', '_');
        }

        if (substr($class, 0, 7) !== 'PHPTAL_') return;

        $path = dirname(__FILE__) . strtr("_".$class, "_", DIRECTORY_SEPARATOR) . '.php';

        require $path;
    }
1229068
public function callRepositoryMethod($restParams, $returnAll = false)
    {
        $repositoryMethod = $restParams->getRepositoryMethod();

        return $this->repository->{$repositoryMethod->getName()}(
            $restParams->getConditions(),
            $restParams->getSorts(),
            $restParams->getJoins(),
            $returnAll ? null : $restParams->getPager(),
            $restParams->getMode(),
            ...$repositoryMethod->getParams()
        );
    }
373382
public function main()
    {
        $className = $this->loadDependencies();

        if (!isset($this->file) and count($this->filesets) == 0) {
            throw new BuildException('Missing either a nested fileset or attribute "file" set');
        }

        if (count($this->formatters) == 0) {
            // turn legacy format attribute into formatter
            $fmt = new PHPMDFormatterElement();
            $fmt->setType($this->format);
            $fmt->setUseFile(false);

            $this->formatters[] = $fmt;
        }

        $reportRenderers = [];

        foreach ($this->formatters as $fe) {
            if ($fe->getType() == '') {
                throw new BuildException('Formatter missing required "type" attribute.');
            }

            if ($fe->getUsefile() && $fe->getOutfile() === null) {
                throw new BuildException('Formatter requires "outfile" attribute when "useFile" is true.');
            }

            $reportRenderers[] = $fe->getRenderer();
        }

        if ($this->newVersion && $this->cache) {
            $reportRenderers[] = new PHPMDRendererRemoveFromCache($this->cache);
        } else {
            $this->cache = null; // cache not compatible to old version
        }

        // Create a rule set factory
        if ($this->newVersion) {
            $ruleSetFactory = new \PHPMD\RuleSetFactory();
        } else {
            if (!class_exists("PHP_PMD_RuleSetFactory")) {
                @include 'PHP/PMD/RuleSetFactory.php';
            }
            $ruleSetFactory = new PHP_PMD_RuleSetFactory();
        }
        $ruleSetFactory->setMinimumPriority($this->minimumPriority);

        /**
         * @var PHPMD\PHPMD $phpmd
         */
        $phpmd = new $className();
        $phpmd->setFileExtensions($this->allowedFileExtensions);
        $phpmd->setIgnorePattern($this->ignorePatterns);

        $filesToParse = $this->getFilesToParse();

        if (count($filesToParse) > 0) {
            $inputPath = implode(',', $filesToParse);

            $this->log('Processing files...');

            $phpmd->processFiles($inputPath, $this->rulesets, $reportRenderers, $ruleSetFactory);

            if ($this->cache) {
                $this->cache->commit();
            }

            $this->log('Finished processing files');
        } else {
            $this->log('No files to process');
        }
    }
40636
function (options, callback) {
        options = extend({}, DEPENDENCY_WRITE_DEFAULTS, options)
        var json = require(options.jsonUri)

        // the JSON DSL has the option to have "/foo" in <moduleNameLeft>
        after.reduce(json, createFoldersIntoFilesIterator(options.uri), 
            {}, runDependencyMapper)

        function runDependencyMapper(err, data) {
            if (err) {
                return callback(err)
            }
            after.map(data, mapToDependencies, callback)
        }

        function mapToDependencies(dependencies, moduleName, callback) {
            if (isFile.test(moduleName)) {
                // the JSON DSL has the option to have "/foo" or ["/foo"]
                // in <moduleNameRight>.
                after.map(dependencies, createConvertToProxyNameIterator({
                    moduleName: moduleName,
                    uri: options.uri
                }), callback)
            }
        }
    }
905960
private static function _autoload($class)
    {
        $realClass = $class;
        if (preg_match('/^JProxy_/i', $class)) {
            $class = preg_replace('/^JProxy_/i', '', $class);
        }
        foreach (self::$prefixes as $prefix => $lookup) {
            $chr = strlen($prefix) < strlen($class) ? $class[strlen($prefix)] : 0;

            if (strpos($class, $prefix) === 0 && ($chr === strtoupper($chr))) {
                $existsBefore = class_exists($realClass, false);
                if ($realClass === $class) {
                    self::loadByAlias($realClass);
                    self::load($realClass);
                }
                $return = true;
                if (!$existsBefore && !class_exists($class, false)) {
                    $return = self::_load(substr($class, strlen($prefix)), $lookup);
                }
                if ($realClass === $class && !$existsBefore && class_exists($realClass, false)) {
                    self::injectStaticDependencies($class);
                }

                return $return;
            }
        }

        return false;
    }
944419
public static function autoload(): void
    {
        //  CI base helpers
        require_once BASEPATH . 'core/Common.php';

        $aComponents = [];
        foreach (Components::available() as $oModule) {
            $aComponents[] = (object) [
                'slug'     => $oModule->slug,
                'autoload' => $oModule->autoload,
            ];
        }

        //  Module items
        foreach ($aComponents as $oModule) {
            //  Helpers
            if (!empty($oModule->autoload->helpers)) {
                foreach ($oModule->autoload->helpers as $sHelper) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sHelper;
                        self::helper($sName, $sProvider);
                    } else {
                        self::helper($sHelper, $oModule->slug);
                    }
                }
            }
            //  Services
            if (!empty($oModule->autoload->services)) {
                foreach ($oModule->autoload->services as $sService) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sService;
                        self::service($sName, $sProvider);
                    } else {
                        self::service($sService, $oModule->slug);
                    }
                }
            }
        }
    }
342911
public function autoload( $class ) {
		$ClassArray = explode( '\\', $class );

		if ( count( $ClassArray ) > 1 ) {

			if ( php_sapi_name() == 'cli' ) {
				$MvcPath = $this->config->get( 'path.basepath' ) . $this->config->get( 'path.mvc' );
			} else {
				$MvcPath = $this->config->get( 'path.mvc' );
			}

			//** if count $ClassArray = 3 is HMVC
			if ( count( $ClassArray ) >= 3 ) {
				$HmvcPath = '';

				for ( $i = 0; $i < count( $ClassArray ) - 2; $i ++ ) {
					$HmvcPath .= $ClassArray[ $i ] . '/';
				}

				//**        MVC Path    /     Module     Controllers/Models                         /    Class.php
				$FileLoad = $MvcPath . '/' . $HmvcPath . $ClassArray[ count( $ClassArray ) - 2 ] . '/' . $ClassArray[ count( $ClassArray ) - 1 ] . '.php';
			} else {
				//**        MVC Path    /    Controller/Models /    Class.php
				$FileLoad = $MvcPath . '/' . $ClassArray[0] . '/' . $ClassArray[1] . '.php';
			}

			if ( file_exists( $FileLoad ) ) {
				include $FileLoad;
			}

		}

	}
711263
public function preLoad()
    {

        $query = new Query( <<<SQL
SELECT
    t.oid AS oid,
    t.typname AS name,
    n.nspname as "schema",
    t.typlen AS length,
    t.typtype AS type,
    t.typcategory AS category,
    t.typarray AS "arrayType",
    t.typdefault AS default,
    t.typdefaultbin AS "defaultBin"
FROM
    pg_type AS t
INNER JOIN
    pg_namespace AS n ON n.oid = t.typnamespace
WHERE
    t.oid IN (
        SELECT
            DISTINCT a.atttypid as "typeOid"
        FROM
            pg_attribute AS a
        INNER JOIN
            pg_type AS t ON t.oid = a.atttypid
        INNER JOIN
            pg_class AS c ON c.oid = a.attrelid
        LEFT JOIN
            pg_catalog.pg_namespace n ON n.oid = c.relnamespace
        WHERE
            n.nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema') AND
            attisdropped = false AND
            attnum > 0
)
;
SQL
        );

        $types = $this->db->query( $query )->fetch();
        parent::cacheInvalidate();
        $this->initByDatas( $types );

    }
591948
final private function registerExtendedPlugin()
    {
        if (self::$appCall != null) {
            if (Server::exist(FEnv::get("framework.apps").FEnv::get("app.call")."/Extra/".
                strtolower(FEnv::get("app.call")).".view.plugin.json")) {
                $file = JsonListener::open(FEnv::get("framework.apps").FEnv::get("app.call")."/Extra/".
                    strtolower(FEnv::get("app.call")).".view.plugin.json");
                foreach ($file as $one => $value) {
                    if ($one == null || $one == "") {
                        throw new Server500(new \ArrayObject(array("explain" =>
                            "Parse error on " . strtolower(FEnv::get("app.call")) . ".view.plugin.json file",
                            "solution" => "Please check the file syntax")));
                    }

                    if (!isset($value->namespace) || ($value->namespace) == "" || ($value->namespace) == null) {
                        throw new Server500(new \ArrayObject(array("explain" =>
                            "Parse error on " . strtolower(FEnv::get("app.call")) .
                            ".view.plugin.json file => Cannot determine the plugin namespace",
                            "solution" => "Please add the correct plugin namespace")));
                    }

                    if (!isset($value->function) || ($value->function) == "" || ($value->function) == null) {
                        throw new Server500(new \ArrayObject(array("explain" =>
                            "Parse error on " . strtolower(FEnv::get("app.call")) .
                            ".view.plugin.json file => Cannot determine the plugin function",
                            "solution" => "Please add the correct plugin function")));
                    }
                    self::$instance->registerPlugin(
                        \Smarty::PLUGIN_FUNCTION,
                        $one,
                        array($value->namespace, $value->function)
                    );
                }
            }
        }
    }
384137
private function autoload($class)
    {
        $class = str_replace('main\\', '', $class);
        //var_dump($class );
        $file = realpath(dirname($this->appPath . '/../../')) . '/' . $class . '.php';
        $file = str_replace(['\\', '//'], ['/', '/'], $file);
        //var_dump($file );
        if (is_file($file)) {
            include_once $file;
            return;
        }
    }