Load the taxonomy associated with this package
@param string $compiledPath
@return boolean|XBRL
773170
public function loadTaxonomy( $compiledPath = null )
	{
		if ( $this->isExtensionTaxonomy() )
		{
			return XBRL::loadExtensionXSD( $this->schemaFile, $this->getXBRLClassname(), $this->schemaNamespace, $compiledPath );
		}
		else
		{
			if ( $this->isCompiled( $compiledPath, $this->getSchemaFileBasename() ) )
			{
				return XBRL::load_taxonomy(
					"$compiledPath/" . $this->getSchemaFileBasename(".json"),
					false
				);
			}

			return XBRL::withTaxonomy( $this->schemaFile );
		}
	}
469234
public function addVendor($vendorPath)
    {
        $dir = $vendorPath . '/composer';
        if (file_exists($file = $dir . '/autoload_namespaces.php')) {
            $map = require $file;
            foreach ($map as $namespace => $path) {
                if (isset($this->namespacePool[$namespace])) continue;
                $this->loader->set($namespace, $path);
                $this->namespacePool[$namespace] = true;
            }
        }
        if (file_exists($file = $dir . '/autoload_psr4.php')) {
            $map = require $file;
            foreach ($map as $namespace => $path) {
                if (isset($this->psr4Pool[$namespace])) continue;
                $this->loader->setPsr4($namespace, $path);
                $this->psr4Pool[$namespace] = true;
            }
        }
        if (file_exists($file = $dir . '/autoload_classmap.php')) {
            $classMap = require $file;
            if ($classMap) {
                $classMapDiff = array_diff_key($classMap, $this->classMapPool);
                $this->loader->addClassMap($classMapDiff);
                $this->classMapPool += array_fill_keys(array_keys($classMapDiff), true);
            }
        }
        if (file_exists($file = $dir . '/autoload_files.php')) {
            $includeFiles = require $file;
            foreach ($includeFiles as $includeFile) {
                $relativeFile = $this->stripVendorDir($includeFile, $vendorPath);
                if (isset($this->includeFilesPool[$relativeFile])) continue;
                require $includeFile;
                $this->includeFilesPool[$relativeFile] = true;
            }
        }
    }
113587
public function parse($docPath)
    {
        if ( ! is_dir($docPath)) {
            throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist.', $docPath));
        }

        $sorter = function(\SplFileInfo $a, \SplFileInfo $b) {
            $aIsDir = $a->isDir();
            $bIsDir = $b->isDir();

            if ($aIsDir !== $bIsDir) {
                return $aIsDir ? -1 : 1;
            }

            return -1 * strcmp($a->getRealPath(), $b->getRealPath());
        };

        $this->classes = $this->functions = $this->constants = $this->aliasedFunctions = array();
        foreach (Finder::create()->in($docPath)->name('*.xml')->sort($sorter) as $file) {
            assert($file instanceof \SplFileInfo);
            $this->file = $file;

            $content = file_get_contents($file->getRealPath());
            $content = preg_replace('#<refsect1 role="(?:examples|notes|seealso)">.*?</refsect1>#s', '', $content);
            $content = preg_replace(self::$undefinedEntities, '', $content);
            $content = preg_replace(array_keys(self::$entitySubstitutes), array_values(self::$entitySubstitutes), $content);

            if ('' === trim($content)) {
                continue;
            }

            $doc = simplexml_load_string($content);
            $doc->registerXPathNamespace('search', 'http://docbook.org/ns/docbook');
            if (isset($doc->refnamediv)) {
                // Ignore methods, we will parse them as part of the class.
                if (false !== strpos((string) $doc->refnamediv->refname, '::')) {
                    $this->parseMethod($doc);

                    continue;
                }

                $this->parseFunction($doc);

                continue;
            }

            $this->tryParsingClass($doc);
            $this->tryParsingConstant($doc);
        }

        if ( ! empty($this->aliasedFunctions)) {
            foreach ($this->functions as $function) {
                $aliasedNames = array_keys($this->aliasedFunctions, $function->getName(), true);

                if (empty($aliasedNames)) {
                    continue;
                }

                foreach ($aliasedNames as $name) {
                    $newFunction = clone $function;
                    $newFunction->setName($name);
                    $newFunction->setAttribute('alias_of', $function->getName());
                    $this->functions[] = $newFunction;
                }
            }
        }

        foreach ($this->classes as $class) {
            $this->typeRefiner->refineClass($class);
        }

        $rs = array('classes' => $this->classes, 'functions' => $this->functions, 'constants' => $this->constants);
        $this->classes = $this->functions = $this->constants = $this->aliasedFunctions = null;

        return $rs;
    }
695515
public function load($basePath)
    {
        $this->assertThatFactoriesDirectoryExists($basePath);

        $designer = new Designer;
        $faker = new FakerAdapter;

        $factory = function ($name, $shortName, $attributes = []) use ($designer, $faker) {
            return $designer->define($name, $shortName, $attributes);
        };

        foreach ((new FactoriesFinder($basePath))->find() as $file) {
            include($file);
        }

        return $designer->definitions();
    }
251543
public function loadByWebappPath($webappPath)
    {
        foreach ($this->findAll() as $appNode) {
            if ($appNode->getWebappPath() == $webappPath) {
                return $appNode;
            }
        }
    }
704198
public static function getSource(array $compiledTemplates)
	{
		$map         = ['dynamic' => [], 'php' => [], 'static' => []];
		$tagNames    = [];
		$unsupported = [];

		// Ignore system tags
		unset($compiledTemplates['br']);
		unset($compiledTemplates['e']);
		unset($compiledTemplates['i']);
		unset($compiledTemplates['p']);
		unset($compiledTemplates['s']);

		foreach ($compiledTemplates as $tagName => $php)
		{
			$renderings = self::getRenderingStrategy($php);
			if (empty($renderings))
			{
				$unsupported[] = $tagName;
				continue;
			}

			foreach ($renderings as $i => list($strategy, $replacement))
			{
				$match = (($i) ? '/' : '') . $tagName;
				$map[$strategy][$match] = $replacement;
			}

			// Record the names of tags whose template does not contain a passthrough
			if (!isset($renderings[1]))
			{
				$tagNames[] = $tagName;
			}
		}

		$php = [];
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	public $enableQuickRenderer=true;';
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected $static=' . self::export($map['static']) . ';';
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected $dynamic=' . self::export($map['dynamic']) . ';';

		$quickSource = '';
		if (!empty($map['php']))
		{
			$quickSource = SwitchStatement::generate('$id', $map['php']);
		}

		// Build a regexp that matches all the tags
		$regexp  = '(<(?:(?!/)(';
		$regexp .= ($tagNames) ? RegexpBuilder::fromList($tagNames) : '(?!)';
		$regexp .= ')(?: [^>]*)?>.*?</\\1|(/?(?!br/|p>)[^ />]+)[^>]*?(/)?)>)s';
		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected $quickRegexp=' . var_export($regexp, true) . ';';

		// Build a regexp that matches tags that cannot be rendered with the Quick renderer
		if (!empty($unsupported))
		{
			$regexp = '(<(?:[!?]|' . RegexpBuilder::fromList($unsupported) . '[ />]))';
			$php[]  = '	/** {@inheritdoc} */';
			$php[]  = '	protected $quickRenderingTest=' . var_export($regexp, true) . ';';
		}

		$php[] = '	/** {@inheritdoc} */';
		$php[] = '	protected function renderQuickTemplate($id, $xml)';
		$php[] = '	{';
		$php[] = '		$attributes=$this->matchAttributes($xml);';
		$php[] = "		\$html='';" . $quickSource;
		$php[] = '';
		$php[] = '		return $html;';
		$php[] = '	}';

		return implode("\n", $php);
	}
79330
public function loadSql(string $fixturePath): array
    {
        if (!file_exists($fixturePath)) {
            throw new FixtureLoaderEx("Fixture $fixturePath does not exist.");
        }

        $handle = @fopen($fixturePath, 'r');

        if (!$handle) {
            throw new FixtureLoaderEx("Error opening fixture $fixturePath.");
        }

        $sqlArr = [];

        $index = 0;
        while (($sql = fgets($handle)) !== false) {
            // Skip comments
            if (substr($sql, 0, 2) == '--') {
                continue;
            }

            $isMultiLineSql = array_key_exists($index, $sqlArr);
            $isEndOfSql = substr($sql, -2, 1) == ';';

            if ($isMultiLineSql) {
                $sqlArr[$index] .= $sql;
            } else {
                $sqlArr[$index] = $sql;
            }

            if ($isEndOfSql) {
                $sqlArr[$index] = trim($sqlArr[$index]);
                ++$index;
            }
        }

        fclose($handle);

        return $sqlArr;
    }
105549
def _load_compiled(self, file_path):
        
        name = os.path.splitext(os.path.split(file_path)[-1])[0]
        plugin_directory = os.sep.join(os.path.split(file_path)[0:-1])
        compiled_directory = os.path.join(plugin_directory, '__pycache__')
        # Use glob to autocomplete the filename.
        compiled_file = glob.glob(os.path.join(compiled_directory, (name + '.*')))[0]
        plugin = imp.load_compiled(name, compiled_file)
        return plugin
1358596
public function loadLocation($locationPath)
    {
        $location = $this->locationService->loadLocation(
            $this->extractLocationIdFromPath($locationPath)
        );

        if (trim($location->pathString, '/') != $locationPath) {
            throw new Exceptions\NotFoundException(
                "Could not find location with path string $locationPath"
            );
        }

        return new Values\CachedValue(
            new Values\RestLocation(
                $location,
                $this->locationService->getLocationChildCount($location)
            ),
            array('locationId' => $location->id)
        );
    }
204700
public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
    {
        $compiled->filepath = false;
        $compiled->timestamp = false;
        $compiled->exists = false;
    }
918232
protected function load()
    {
        $path = $this->vendorDir . '/composer';
        if (!is_dir($path)) throw new InvalidProjectException('"composer" folder has not been found. Be sure to use this bundle on a project managed by Composer');

        $map = require $path . '/autoload_namespaces.php';
        foreach ($map as $namespace => $paths) {
            if ( ! is_array($paths)) {
                $paths = array($paths);
            }
            
            foreach ($paths as $path) {
                if (substr($path, -1) != '/') { 
                    $path .= '/';
                }

                $dir = $path . str_replace('\\', '/', $namespace);

                $bundleName = $this->getBundleName($dir);
                $this->addBundle($bundleName, $dir);
            }
        }
        
        $this->parseExtraFolders();
    }
325598
protected function registerBundleTypes($path, $namespace)
    {
        $finder = new Finder();
        foreach ($finder->in($path)->name('/Type.php$/')->getIterator() as $file) {
            $className = preg_replace('/.php$/', null, $file->getFilename());

            if ($file->getRelativePath()) {
                $subNamespace = str_replace('/', '\\', $file->getRelativePath());
                $fullyClassName = $namespace.'\\Type\\'.$subNamespace.'\\'.$className;
            } else {
                $fullyClassName = $namespace.'\\Type\\'.$className;
            }

            if (class_exists($fullyClassName)) {
                $ref = new \ReflectionClass($fullyClassName);
                if ($ref->isSubclassOf(Type::class) && $ref->isInstantiable()) {
                    $requiredParams = false;
                    foreach ($ref->getConstructor()->getParameters() as $parameter) {
                        if ($parameter->getClass() && $parameter->getClass()->implementsInterface(DefinitionInterface::class)) {
                            continue 2;
                        }
                    }

                    if ($requiredParams) {
                        $error = sprintf('The graphql type defined in class "%s" is not instantiable because has some required parameters in the constructor.', $fullyClassName);
                        throw new \LogicException($error);
                    }
                    /** @var Type $instance */
                    $instance = $ref->newInstance();
                    TypeRegistry::addTypeMapping($instance->name, $fullyClassName);
                }
            }
        }
    }
1159940
public function loadLanguage($extension = '', $basePath = ANPATH_BASE)
  	{
  		if (empty($extension)) {
  		    $extension = 'plg_'.$this->getIdentifier()->package.'_'.$this->getIdentifier()->name;
  		}

  		return AnService::get('anahita:language')->load( strtolower($extension), $basePath);
  	}
939536
public static function compiled_taxonomy_for_xsd( $xsd )
	{
		return isset( XBRL::$xsd_to_compiled_map[ $xsd ] ) ? XBRL::$xsd_to_compiled_map[ $xsd ] : null;
	}
97361
private function compileFiles(string $viewPath)
    {
        $directory = new RecursiveDirectoryIterator($viewPath, FilesystemIterator::SKIP_DOTS);

        foreach (new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST) as $file) {
            /** @var SplFileInfo $file */
            if ($file->isFile() && $file->getExtension() === 'twig') {
                $templateName = substr($file->getPathname(), strlen($viewPath) + 1);
                $templateName = str_replace('\\', '/', $templateName);
                //echo sprintf("Parsing: %s\n", $templateName);
                $this->twig->loadTemplate($templateName);
            }
        }
    }
562257
private function loadVersion($basePath)
	{
		static $locations = array(
			'/libraries/cms/version/version.php',
			'/libraries/joomla/version.php',
		);

		define('_JEXEC', 1);

		foreach ($locations as $location)
		{
			if (file_exists($basePath . $location))
			{
				$code = file_get_contents($basePath . $location);
				$code = str_replace("defined('JPATH_BASE')", "defined('_JEXEC')", $code);
				eval('?>' . $code);

				return new \JVersion;
			}
		}
		throw new \RuntimeException('Unable to locate version information');
	}
1053678
public static function loadContextFromFile(string $filePath): ContextInterface
    {
        if(!file_exists($filePath)){
            throw new Exception\FileNotFoundException('Context file not found: '.$filePath, 404, null, $filePath);
        }

        $contents = file_get_contents($filePath);
        $context_array = json_decode($contents, true);

        if($context_array === null){
            throw new Exception\MalformedJsonException('JSON sintax error.');
        }

        return new self($context_array);
    }