FOF30\Factory\Scaffolding\Layout\Builder::applyStrings PHP Метод

applyStrings() защищенный Метод

Load the strings array in Joomla!'s JLanguage object
protected applyStrings ( )
    protected function applyStrings()
    {
        // If we don't have language strings there's no point continuing
        if (empty($this->strings)) {
            return;
        }
        // Get a temporary filename
        $baseDirs = $this->container->platform->getPlatformBaseDirs();
        $tempDir = $baseDirs['tmp'];
        $filename = tempnam($tempDir, 'fof');
        if ($filename === false) {
            return;
        }
        // Save the strings to a temporary file
        $this->saveStrings($filename);
        // Load the temporary file
        $lang = $this->container->platform->getLanguage();
        $langReflection = new \ReflectionObject($lang);
        $loadLangReflection = $langReflection->getMethod('loadLanguage');
        $loadLangReflection->setAccessible(true);
        $loadLangReflection->invoke($lang, $filename, $this->container->componentName);
        // Delete temporary filename
        @unlink($filename);
    }