Installs this class loader on the SPL autoload stack.

@param bool $throw   If register should throw an exception or not
@param bool $prepend If register should prepend

@return void
175350
public function register($throw = true, $prepend = false)
    {

        // require all the files found in the directory
        foreach ($this->directories as $directory) {
            foreach (glob($directory) as $file) {
                require_once $file;
            }
        }
    }
1276177
public static function add_namespaces(array $namespaces, $prepend = false)
	{
		if ( ! $prepend)
		{
			static::$namespaces = array_merge(static::$namespaces, $namespaces);
		}
		else
		{
			static::$namespaces = $namespaces + static::$namespaces;
		}
	}
895898
public function addJsUrl(string $src, bool $defer = false, bool $prepend = false, array $attrs = null, 
			$target = self::TARGET_HEAD) {
		ArgUtils::valEnum($target, array(self::TARGET_HEAD, self::TARGET_BODY_START, self::TARGET_BODY_END));
		
		if ($target == self::TARGET_HEAD) {
			$target = self::HEAD_SCRIPT_KEY;
		}
		
		$attrs = (array) $attrs;
		if ($defer) {
			$attrs['defer'] = 'defer';
		}
		
		$htmlElement = new HtmlElement('script', HtmlUtils::mergeAttrs(
				array(/*'type' => 'text/javascript', */'src' => $src), $attrs), '');
		
		$this->htmlProperties->add($target, 'type:javascript:src:' . $src, $htmlElement, $prepend);
		
		return $this;
	}
273726
public static function register($prepend = false)
    {
        if (self::$registered) {
            return;
        }

        spl_autoload_register(array(__CLASS__, 'loadClass'), true, $prepend);
        self::$registered = true;
    }
810117
public function preAutoloadDump()
    {
        $graph = $this->getGraph();
        $this->io->write('<info>Pass 1/3: Generating compound traits and interfaces</info>');
        $this->generateCompoundCode($graph);

        $this->io->write('<info>Pass 2/3: Preparing individual generation</info>');
        $this->generateEmptyCode($graph);
    }
1190338
public function addAsyncJsUrl(string $src, bool $prepend = false) {
		$this->htmlProperties->add(self::HEAD_SCRIPT_KEY, 'type:javascript:src:' . $src,
				new HtmlElement('script', array(/*'type' => 'text/javascript'*/),
						"\r\n" . '//<![CDATA[' . "\r\n" . '(function() {var b=document.createElement("script");b.type="text/javascript";b.async=true;b.src="' .
						addslashes($src) . '";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)})();' . "\r\n" . '//]]>' . "\r\n"),
				$prepend);
		
		return $this;
	}
1059305
public function prependBeforeFilter($filter, array $options = [])
    {
        array_unshift($this->beforeFilters, $this->parseFilter($filter, $options));
    }
235865
final public static function autoloadRegister()
    {
        // spl_autoload_register disables oldschool autoload
        // even if it was added using spl_autoload_register!
        // this is intended to preserve old autoloader

        $uses_autoload = function_exists('__autoload')
            && (!($tmp = spl_autoload_functions()) || ($tmp[0] === '__autoload'));

        // Prepending PHPTAL's autoloader helps if there are other autoloaders
        // that throw/die when file is not found. Only >5.3 though.
        if (version_compare(PHP_VERSION, '5.3', '>=')) {
            spl_autoload_register(array(__CLASS__,'autoload'), false, true);
        } else {
            spl_autoload_register(array(__CLASS__,'autoload'));
        }

        if ($uses_autoload) {
            spl_autoload_register('__autoload');
        }
    }
654024
public function beforeCompile(): void
	{
		$config = $this->validateConfig($this->defaults);
		$builder = $this->getContainerBuilder();

		$templateFactory = $builder->getByType(ILatteFactory::class);
		if ($templateFactory === null) {
			throw new InvalidStateException(sprintf('Service which implements %s not found.', ILatteFactory::class));
		}

		$builder->getDefinition($templateFactory)
			->addSetup('addFilter', [$config['helper'], [new Statement(ParsedownFilter::class), 'apply']]);
	}
356110
public static function registerBC($prepend = false)
    {
        /**
         * register the class autoloader
         */
        if (!defined('SMARTY_SPL_AUTOLOAD')) {
            define('SMARTY_SPL_AUTOLOAD', 0);
        }
        if (SMARTY_SPL_AUTOLOAD &&
            set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false
        ) {
            $registeredAutoLoadFunctions = spl_autoload_functions();
            if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {
                spl_autoload_register();
            }
        } else {
            self::register($prepend);
        }
    }
323397
static public function askForUserConfirmation(bool $throwException = false): bool {
		echo "\n######################################################\n\n";
		echo "Are you sure that you want to import data to the following instance?! \n\n ";
		echo "Type 'yes' to continue! \n\n";
		echo self::get('sparqlUrl') . "\n";
		echo self::get('fedoraApiUrl') . "\n";
		$handle = fopen ("php://stdin","r");
		$line = trim(fgets($handle));
		fclose($handle);
		if ($line !== 'yes' && $throwException) {
			throw new RuntimeException('Configuration revoked by the user');
		}
		return $line === 'yes';
	}
5599
public function add($prefix, $paths, $prepend = false) {
		if (!$prefix) {
			if ($prepend) {
				$this->fallbackDirs = array_merge(
					(array) $paths,
					$this->fallbackDirs
				);
			}
			else {
				$this->fallbackDirs = array_merge(
					$this->fallbackDirs,
					(array) $paths
				);
			}

			return;
		}

		if (!isset($this->prefixes[$prefix])) {
			$this->prefixes[$prefix] = (array) $paths;
			return;
		}

		if ($prepend) {
			$this->prefixes[$prefix] = array_merge(
				(array) $paths,
				$this->prefixes[$prefix]
			);
		}
		else {
			$this->prefixes[$prefix] = array_merge(
				$this->prefixes[$prefix],
				(array) $paths
			);
		}
	}
1163285
public function add_template_directory($path, $namespace = null, $prepend = false) {
		$template_directory = [
			'directory' => $path,
			'namespace' => $namespace
		];

		if ($prepend) {
			array_unshift($this->template_directories, $template_directory);
		} else {
			array_push($this->template_directories, $template_directory);
		}
	}
7846
public static function preProcessing(Compiler $compiler, array $params, $prepend, $append, $type)
    {
        $with = &$compiler->findBlock('for', true);

        $params['initialized'] = true;
        $compiler->injectBlock($type, $params);

        return '';
    }
862542
public function beforeCompile(): void
	{
		$builder = $this->getContainerBuilder();

		// Register as services
		foreach ($builder->findByType(IContainerAware::class) as $service) {
			$service->addSetup('setContainer');
		}
	}
1125391
public function register() {
        if (!$this->registered) {
            spl_autoload_register([$this, 'autoLoad'], $throw=true, $prepend=false);
            $this->registered = true;
        }
        return $this;
    }
95176
public static function register($prepend = false)
    {
        if (version_compare(phpversion(), '5.3.0', '>=')) {
            spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
        } else {
            spl_autoload_register(array(__CLASS__, 'autoload'));
        }
    }