Set compiler root

@param string $path Path

@return null
557256
public function setCompilerRoot($path)
  {
    $path = realpath($path);
    if (is_dir($path)) {
      $this->root = $path;
    }
  }
1356468
public function setBasePath($path)
    {
        foreach ($this->loaders as $loader) {
            if ($loader instanceof FileLoaderInterface) {
                $loader->setBasePath($path);
            }
        }
    }
1145987
protected function _setPreviewDir($path = null) {
		$path = (string)$path;
		if (file_exists($path)) {
			$this->_pathPreviewDir = $path;
		}
	}
19348
public static function root($path = null)
    {
        if (! is_null($path)) {
            if (! $path instanceof KhttpUrl) {
                $path = AnService::get('anahita:http.url', array('url' => $path));
            }

            self::$_root = $path;
        }

        if (is_null(self::$_root)) {
            self::$_root = self::$_base;
        }

        return self::$_root;
    }
771050
public function setBasePath($path) {
		$path = rtrim($path, '\/');
		
		if (preg_match('~^[a-z]+:~', $path)) {
			$this->basePath = $path;
			$this->isLocal  = false;
			return;
		}
		
		$this->basePath = realpath($path);
		$this->isLocal  = true;
		
		return $this;
	}
1309462
public function setBasePath($path) {
		$path = rtrim($path, DIRECTORY_SEPARATOR);
		
		if (! file_exists($path) || ! is_dir($path)) {
			throw new ConfigError('Base directory does not exists: "' . $path . '"');
		}
		
		$this->_basePath = $path;
		
		return $this;
	}
1041844
public function setPath($path)
    {
        if (!file_exists($path))
        {
            mkdir($path, 0777, true);
        }

        $this->path = $path;
    }
144394
private function setPath($path)
    {
        $this->path =  preg_replace_callback(
            '/(?:[^' . self::$charList . ':@\/%]+|%(?![A-Fa-f0-9]{2}))/',
            [$this, 'encode'],
            $path
        );

        return $this;
    }
881383
public function compile($path = null)
    {
        if ($path) {
            $this->setPath($path);
        }

        if (!is_null($this->cachePath)) {
            if (!is_file($path)) {
                throw new \RuntimeException("File does not exist at path {$path}");
            }

            file_put_contents(
                $this->getCompiledPath($path),
                $this->compileString(file_get_contents($path))
            );
        }
    }
58823
public function setCommandersPath($path)
    {
        $path = str_replace(['\\' . '/'], DIRECTORY_SEPARATOR, $path);
        $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

        if (is_dir($path)) {
            $this->commandersPath = $path;
        }

        return $this;
    }
325114
public static function usePath($path)
    {
        # Use the document root normally set via apache
        if ($path === self::PATH_DOCUMENT_ROOT) {
            if (empty($_SERVER["DOCUMENT_ROOT"]) || !is_dir($_SERVER["DOCUMENT_ROOT"])) {
                throw new \InvalidArgumentException("DOCUMENT_ROOT not defined");
            }
            static::$path = $_SERVER["DOCUMENT_ROOT"];
            return;
        }

        # Get the full path of the running script and use it's directory
        if ($path === self::PATH_PHP_SELF) {
            if (empty($_SERVER["PHP_SELF"]) || !$path = realpath($_SERVER["PHP_SELF"])) {
                throw new \InvalidArgumentException("PHP_SELF not defined");
            }
            static::$path = pathinfo($path, PATHINFO_DIRNAME);
            return;
        }

        # Calculate the parent of the vendor directory and use that
        if ($path === self::PATH_VENDOR_PARENT) {
            static::$path = realpath(__DIR__ . "/../../../..");
            return;
        }

        if (is_dir($path)) {
            static::$path = $path;
        } else {
            throw new \InvalidArgumentException("Invalid path specified");
        }
    }
173199
public function setPath($path)
    {
        if ($this->path) {
            $this->old_paths[] = $this->path;
        }
        $this->path = $path;

        return $this;
    }
1134943
protected function _setExportDir($path = null) {
		$path = (string)$path;
		if (file_exists($path)) {
			$this->_pathExportDir = $path;
		}
	}
619538
function setPath($path = null)
    {
        if ($path === null)
            $path = array();

        // the associate array is useless
        $this->_pathSequence = array_values( (array) $path);
        return $this;
    }
855500
public function compile($path = null)
    {
        if ($path) {
            $this->setPath($path);
        }

        if (! is_null($this->cachePath)) {
            $contents = $this->compileString(
                $this->files->get($this->getPath())
            );

            if (! empty($this->getPath())) {
                $tokens = $this->getOpenAndClosingPhpTokens($contents);

                // If the tokens we retrieved from the compiled contents have at least
                // one opening tag and if that last token isn't the closing tag, we
                // need to close the statement before adding the path at the end.
                if ($tokens->isNotEmpty() && $tokens->last() !== T_CLOSE_TAG) {
                    $contents .= ' ?>';
                }

                $contents .= "<?php /**PATH {$this->getPath()} ENDPATH**/ ?>";
            }

            $this->files->put(
                $this->getCompiledPath($this->getPath()), $contents
            );
        }
    }
238594
public function setTemplatePath(string $path = null, string $context = null) : self
    {
        if (empty($path)) {
            $this->templatePath = $this->getPath($context)['dirname'] . '/' . $this->getPath($context)['filename'];
        } elseif (substr($path, 0, 1) == '/') {
            $this->templatePath = $path;
        } else {
            $this->templatePath = $this->getPath($context)['dirname'] . '/' . $path;
        }

        return $this;
    }
944175
public function setRuntimePath($path)
    {
        $this->_runtimePath = $this->getAlias($path);
        $this->setAlias('@runtime', $this->_runtimePath);
    }