Used internally in order to derive the list of extensions that are used
by a particular processor.

@return void
191120
private function deriveExtensionMapping($name, array $extensions)
    {
        // Iterate through all of the extensions
        foreach($extensions as $extension)
        {
            // Check if it exists
            if(!isset($this->extensionMapping[$extension]))
            {
                // It doesn't, so initialize it
                $this->extensionMapping[$extension] = array();
            }

            // Add a mapping between the two
            $this->extensionMapping[$extension][] = $name;
        }
    }
648894
public function actionCompileAll()
    {
        
        // Get the list of languages that will be compiled.
        $this->outVerbose("Compiling all languages for extension '" . $this->options['extension'] . "'...");
        
        $rootDir = ROOT_PATH;
        $extensionDir = $rootDir . '/' . $this->options['extension'];
        $localesDir = $extensionDir . '/locales';
        $locales = array();
        
        $directories = scandir($localesDir);
        if ($directories === false) {
            $this->err("The locales directory of extension '" . $this->options['extension'] . "' cannot be read.", true);    
        } else {
            foreach ($directories as $dir) {
                if ($dir[0] !== '.') {
                    // It is a language directory.
                    $locales[] = $dir;
                }
            }
        }
        
        foreach ($locales as $l) {
            $this->options['language'] = $l;
            $this->checkCompileInput();
            $this->actionCompile();
            
            $this->outVerbose("");
        }
        
    }
578442
public function actionAllVersionExtensions()
	{
		Output::line();
		$result = ArrayHelper::map(Yii::$app->extensions, 'name', 'version');
		Output::arr($result, 'Repository version list');
	}
299509
public function preCompileHeaders()
    {
        if (is_windows()) {
            // TODO: Add Windows support
            return;
        }

        $phpIncludes = $this->getPhpIncludeDirs();

        foreach (new \DirectoryIterator('ext/kernel') as $file) {
            if ($file->isDir()) {
                continue;
            }

            if (preg_match('/\.h$/', $file)) {
                $path = $file->getRealPath();

                $command = sprintf(
                    'cd ext && gcc -c kernel/%s  -I. %s  -o kernel/%s.gch',
                    $file->getBaseName(),
                    $phpIncludes,
                    $file->getBaseName()
                );

                if (!file_exists($path.'.gch') || filemtime($path) > filemtime($path.'.gch')) {
                    $this->filesystem->system($command, 'stdout', 'compile-header');
                }
            }
        }
    }
298992
public static function getAllowedExtensions()
    {
        $config = static::config()->get('allowed_extensions');

        $allowedExtensions = [];
        foreach ($config as $key => $value) {
            if (is_int($key)) {
                // Numeric indexes, example: [jpg, png, gif]
                $key = $value;
                $value = true;
            }

            // Skip disabled extensions
            if (in_array($value, [null, false], true)) {
                continue;
            }

            $allowedExtensions[] = strtolower($key);
        }
        return $allowedExtensions;
    }
53767
public function setExtensions($extensions)
    {
        $this->_extensions = array();
        $token             = ' ,;';
        $extension         = strtok($extensions, $token);

        while ($extension !== false) {
            $this->_extensions[] = $extension;
            $extension           = strtok($token);
        }

    }
664821
protected function compile_extensions($value) {

        foreach ($this->extensions as &$compiler) {
            $value = call_user_func($compiler, $value);
        }

        return $value;
    }
503229
public function getExtensions()
		{

			// Loop through extension map
			$exts = array();
			foreach (self::$extensionMap as $ext => $type) {
				if ($type == $this->type) {
					$exts[] = $ext;
				}
			}
			return $exts;

		}
307212
protected function processIncludes()
    {
        foreach ($this->getXml()->xpath('/includes/include[@type != "" and @file != ""]') as $include) {
            $processor = $this->getIncludeProcessor((string)$include['type']);
            if (!$processor) {
                trigger_error(sprintf('No include processor for "%s" available. Did you forget to register it?', (string)$include['type']), E_USER_WARNING);
                continue;
            }

            $file = $this->getModulePath((string)$include['file']);
            $processor->load($file, $this->manifest);
        }

        return $this;
    }
1100501
protected function _compile_extensions($value)
    {
        foreach ($this->_extensions as $compiler) {
            $value = call_user_func($compiler, $value);
        }

        return $value;
    }
354439
public function load_extensions() {
		$extensions = [
			new \Frozzare\Digster\Extensions\Filter_Extensions(),
			new \Frozzare\Digster\Extensions\Function_Extensions(),
			new \Frozzare\Digster\Extensions\Global_Extensions(),
			new \Frozzare\Digster\Extensions\I18n_Extensions()
		];

		/**
		 * Modify extensions or add custom.
		 *
		 * @param array $extensions
		 */
		$extensions = apply_filters( 'digster/extensions', $extensions );

		// Register extensions with engine.
		$this->factory->engine()->register_extensions( $extensions );
	}
17257
protected function locateDeclarations()
    {
        foreach ($this->getTokens() as $tokenID => $token) {
            if (!in_array($token[self::TOKEN_TYPE], self::$processTokens)) {
                continue;
            }

            switch ($token[self::TOKEN_TYPE]) {
                case T_NAMESPACE:
                    $this->registerNamespace($tokenID);
                    break;

                case T_USE:
                    $this->registerUse($tokenID);
                    break;

                case T_FUNCTION:
                    $this->registerFunction($tokenID);
                    break;

                case T_CLASS:
                case T_TRAIT:
                case T_INTERFACE:
                    if ($this->isClassNameConst($tokenID)) {
                        //PHP5.5 ClassName::class constant
                        continue 2;
                    }

                    $this->registerDeclaration($tokenID, $token[self::TOKEN_TYPE]);
                    break;

                case T_INCLUDE:
                case T_INCLUDE_ONCE:
                case T_REQUIRE:
                case T_REQUIRE_ONCE:
                    $this->hasIncludes = true;
            }
        }

        //Dropping empty namespace
        if (isset($this->namespaces[''])) {
            $this->namespaces['\\'] = $this->namespaces[''];
            unset($this->namespaces['']);
        }
    }
796031
protected function getExtensions() {
        if (!$this->_extensions) {
            $this->_extensions = new InstalledAddOnExtensionList($this->version, $this->solution['sid']);
        }

        return $this->_extensions;
    }
1130458
public function getEnabledExtensions()
    {
        $returnValue = array();

        $enabled = $this->getExtensionById('generis')->getConfig(self::EXTENSIONS_CONFIG_KEY);
        foreach ($this->getInstalledExtensions() as $ext) {
            if (isset($enabled[$ext->getId()]) && $enabled[$ext->getId()]['enabled']) {
                $returnValue[$ext->getId()] = $ext;
            }
        }
    
        return (array) $returnValue;
    }
923124
private function loadExtensions($extensions)
    {
        $extensions = Arr::wrap($extensions);

        foreach ($extensions as $extension) {
            $extension = 'ext'.$extension;

            if (method_exists($this, $extension)) {
                $this->$extension();
            }
        }
    }
1152898
public function getEnabledExtensions()
    {
        $enabled = [];
        $extensions = $this->getExtensions();

        foreach ($this->getEnabled() as $id) {
            if (isset($extensions[$id])) {
                $enabled[$id] = $extensions[$id];
            }
        }

        return $enabled;
    }
552805
public function addExtensions($extensions)
    {
        $extensions = array_merge($this->_extensions, (array)$extensions);
        $this->_extensions = array_unique($extensions);
    }