Set phpBB Version

@param string $originIso		The ISO of the language to validate
@param string $originPath	Path to the origin directory
@param string $originLanguagePath	Relative path to the origin language/ directory
@return $this
14957
public function setOrigin($originIso, $originPath, $originLanguagePath)
	{
		$this->originIso = $originIso;
		$this->originPath = $originPath;
		$this->originLanguagePath = $originLanguagePath;
		$this->langkeyValidator->setOrigin($originIso, $originPath, $originLanguagePath);
		return $this;
	}
209641
private function LanguageCsvFile($basePath)
    {
        $ext = IO\Path::Extension($basePath);
        $baseFile = IO\Path::RemoveExtension($basePath);
        $langFile = IO\Path::AddExtension($baseFile, $this->language);
        return IO\Path::AddExtension($langFile, $ext);
    }
122690
private function setXliffDirectory(InputInterface $input, OutputInterface $output)
    {
        $this->txlang = $input->getOption('xliff');

        if ($this->txlang === null) {
            $this->txlang = $this->getTransifexConfigValue('/languages_tx');

            if ($this->txlang === null) {
                throw new \RuntimeException('Error: unable to determine transifex root folder.');
            }
            $this->writelnVerbose($output, sprintf('<info>automatically using xliff folder: %s</info>', $this->txlang));
        }
    }
2175
public function setLanguage($lang = 'en', $langDir = __DIR__ . '/lang/')
    {
        $this->lang    = $lang;
        $this->langDir = $langDir;

        $langFile = realpath($langDir . $lang . '.php');
        if (!file_exists($langFile)) {
            throw new \InvalidArgumentException('No such file: ' . $langDir . $lang . '.php');
        }

        $callable = require $langFile;
        $callable($this);

        return $this;
    }
1363005
private static function setIni()
    {
        self::$origIniSettings['error_reporting'] = error_reporting(E_ALL);

        // We won't bother storing original max_execution_time, since 1) the value in
        // php.ini may be wrong (and there's no way to get the current value) and
        // 2) it would mean something very strange to set it to a value less than time script
        // has already been running, which would be the likely change.

        set_time_limit(0);

        self::$origIniSettings['short_open_tag'] = ini_set('short_open_tag', 'off');
        self::$origIniSettings['default_charset'] = ini_set('default_charset', 'iso-8859-1');
        self::$origIniSettings['track_errors'] = ini_set('track_errors', 1);

        $mem_limit = (int) self::convertShorthand(ini_get('memory_limit'));
        if ($mem_limit < (32 * 1024 * 1024) && $mem_limit > -1) {
            // We do *not* need to save the original value here, since we don't plan to restore
            // this after shutdown (we don't trust the effectiveness of PHP's garbage collection).
            ini_set('memory_limit', '32M'); // nore: this may need to be higher for many projects
        }
    }
600230
public function checkRootPath($rootpath){
        /* 设置根目录 */
        $this->rootPath = ftp_pwd($this->link) . '/' . ltrim($rootpath, '/');

        if(!@ftp_chdir($this->link, $this->rootPath)){
            $this->error = '上传根目录不存在！';
            return false;
        }
        return true;
    }
1332277
public function setLogFilePaths($accessLogPath, $requestLogPath, $errorLogPath, $debugLogPath)
    {
        if (!empty($accessLogPath)) {
            $this->logFiles[self::LOGTYPE_ACCESS]['path'] = $accessLogPath;
        }

        if (!empty($requestLogPath)) {
            $this->logFiles[self::LOGTYPE_REQUEST]['path'] = $requestLogPath;
        }

        if (!empty($errorLogPath)) {
            $this->logFiles[self::LOGTYPE_ERROR]['path'] = $errorLogPath;
        }

        if (!empty($debugLogPath)) {
            $this->logFiles[self::LOGTYPE_DEBUG]['path'] = $debugLogPath;
        }
    }
262083
public function copyDirectory($sourcePath, $destinationPath)
    {
        $sourceDirectory = opendir($sourcePath);

        if (! is_dir($destinationPath)) {
            self::createDirectory($destinationPath);
        }
        while (false !== ($file = readdir($sourceDirectory))) {
            if (($file !== '.') && ($file !== '..')) {
                $sourceFile = $sourcePath.'/'.$file;
                $destinationFile = $destinationPath.'/'.$file;
                if (is_dir($sourceFile)) {
                    self::copyDirectory($sourceFile, $destinationFile);
                } else {
                    self::copyFile($sourceFile, $destinationFile);
                }
            }
        }
        closedir($sourceDirectory);
    }
636796
public function setOriginSize($originWidth, $originHeight)
    {
        $this->originWidth = $originWidth;
        $this->originHeight = $originHeight;

        return $this;
    }
565890
private static function validateSource($basePath, $sourcePath)
    {
        $urlData = parse_url($sourcePath);
        if (!empty($urlData['scheme'])) {
            return;
        }

        if (!\helpers_File::isFileInsideDirectory($sourcePath, $basePath)) {
            throw new InvalidSourcePathException($basePath, $sourcePath);
        }
    }
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);
  	}
726382
public function registerGroups(string $namespace, string $basePath): self
    {
        $length   = \strlen($basePath) + 1;
        $iterator = Helper::directoryIterator($basePath, $this->getFileFilter());

        foreach ($iterator as $file) {
            $class = $namespace . '\\' . \substr($file, $length, -4);
            $this->addController($class);
        }

        return $this;
    }
1351904
public function bootstrap(?string $basePath = null): self
    {
        $this->createApplication($basePath);
        $this->baseKernelBinding();

        return $this;
    }
52281
public function createClone(Page $originPage = null)
    {
        $class = ClassUtils::getRealClass($this);
        $clone = new $class(null, null);
        $clone->_accept = self::getShortClassname($this->_accept);
        $clone->_maxentry = $this->_maxentry;
        $clone->_minentry = $this->_minentry;
        $clone->_parameters = $this->_parameters;
        $clone->_mainnode = $this->_mainnode;

        if (
            null !== $originPage
            && is_array($originPage->cloningData)
            && array_key_exists('contents', $originPage->cloningData)
        ) {
            $originPage->cloningData['contents'][$this->getUid()] = $clone;
        }

        if (!($this instanceof ContentSet)) {
            foreach ($this->_data as $key => $values) {
                foreach ($values as $type => &$value) {
                    if (is_array($value)) {
                        $keys = array_keys($value);
                        $values = array_values($value);

                        $type = end($keys);
                        $value = end($values);
                    }

                    if ('scalar' === $type) {
                        $decode = json_decode($value, true);
                        $clone->$key = (JSON_ERROR_NONE === json_last_error()) ? ((null === $decode) ? $value : $decode) : $value;
                    } elseif ('array' !== $type) {
                        foreach ($this->_subcontent as $subcontent) {
                            if ($subcontent->getUid() == $value) {
                                $newsubcontent = $subcontent->createClone($originPage);
                                $clone->$key = $newsubcontent;
                                break;
                            }
                        }
                    } else {
                        $clone->$key = $value;
                    }
                }
                unset($value);
            }
        }

        return $clone;
    }
494133
protected function createLanguageList($selected = null, $basePath = JPATH_ROOT)
	{
		$list = array();

		$langHelper = new LanguageHelper;
		$langs      = $langHelper->getKnownLanguages($basePath);

		foreach ($langs as $lang => $metadata)
		{
			$option = array();

			$option['text'] = $metadata['name'];
			$option['value'] = $lang;

			if ($selected && $lang == $selected)
			{
				$option['selected'] = 'selected="selected"';
			}

			$list[] = (object) $option;
		}

		return $list;
	}
441583
public function addGlobPath($globPath) {
    foreach(glob($globPath, GLOB_BRACE) as $definitionFile) {
      $this->addDefinitions($definitionFile);
    }
    return $this;
  }
318627
public function createClone(Page $originPage = null)
    {
        $clone = parent::createClone($originPage);

        $zones = array();
        $mainNodeUid = null;

        if (null !== $originPage) {
            $mainNodeUid = $originPage->getUid();
            if ($originPage->getContentSet()->getUid() === $this->getUid()) {
                $zones = $originPage->getLayout()->getZones();
            }
        }

        foreach ($this as $subcontent) {
            if (!($subcontent instanceof AbstractClassContent)) {
                continue;
            }

            if (
                $this->getProperty('clonemode') === 'none'
                || ($this->key() < count($zones) && $zones[$this->key()]->defaultClassContent === 'inherited')
                || (null !== $subcontent->getMainNode() && $subcontent->getMainNode()->getUid() !== $mainNodeUid)
            ) {
                $clone->push($subcontent);
            } else {
                $newSubcontent = $subcontent->createClone($originPage);
                $clone->push($newSubcontent);
            }
        }

        return $clone;
    }