Sets the path of the platform, if nothing is set, then it will use the default path of this platform

@param $documentRoot
772011
public function setDocumentRoot($documentRoot)
    {
        if ($documentRoot) {
            $this->documentRoot = $documentRoot;
        } else {
            $this->documentRoot = $this->getDefaultDocRoot();
        }
    }
271175
public function setPathPart($pathPart)
	{
		// Remove all special characters
		$pathPart = strtr($pathPart, array('/' => '', '\\' => '', '#' => '', '?' => '', ' ' => '', '%' => ''));
		$pathPart = trim($pathPart);

		$this->pathPart = $pathPart;
	}
576615
public function initialize($webRoot, $scriptFileName = PATH_site, $phpSelf = '/index.php', $scriptName = '/index.php')
    {
        // if the environment has be initialized once, we do not need to initialize it twice.
        if ($this->isInitialized) {
            return false;
        }

        if (defined('TYPO3_PATH_WEB')) {
            throw new WebRootAllReadyDefinedException('TYPO3_PATH_WEB is already defined');
        }

        define('TYPO3_PATH_WEB', $webRoot);
        $_SERVER['SCRIPT_FILENAME'] = $scriptFileName;
        $_SERVER['PHP_SELF'] = $phpSelf;
        $_SERVER['SCRIPT_NAME'] = $scriptName;

        $this->isInitialized = true;
        return true;
    }
1356468
public function setBasePath($path)
    {
        foreach ($this->loaders as $loader) {
            if ($loader instanceof FileLoaderInterface) {
                $loader->setBasePath($path);
            }
        }
    }
1241289
public function setWebRootPath($path)
    {
        if (@file_exists($path) && is_dir($path)) {
            $this->web_root_path = realpath($path).'/';
        } else {
            throw new \InvalidArgumentException(
                sprintf('Web root path "%s" was not found or is not a directory!', $path)
            );
        }
        return $this;
    }
1145681
protected function initializeCommonMark($mediaRoot)
    {
        $environment = Environment::createCommonMarkEnvironment();
        $environment->addInlineParser(new MediaParser($mediaRoot));

        return $environment;
    }
853848
public function initializeWithUrlAndRootPath($url, $root_path)
    {
        $this->initializeWithUrl($url);
        $this->root_path = $root_path;

        return $this;
    }
1233777
public function setRoot($root)
    {
        // do nothing if root isn't a valid prefix
        if (empty($root)) {
            return null;
        }

        // Kill slash padding and add a trailing slash afterwards
        $root = trim($root, '/');
        $root .= '/';
        $this->root = $root;
    }
1242046
public function setRootAndPath(Document $root, $path)
    {
        Archive::set($this, 'root_and_path', array('root' => $root, 'path' => $path));

        if (isset($this->data['embeddedsOne'])) {
            foreach ($this->data['embeddedsOne'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }

        if (isset($this->data['embeddedsMany'])) {
            foreach ($this->data['embeddedsMany'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }
    }
993352
function setAsRootDocument(doc) {
  rootDoc = doc;
  var window = rootDoc.defaultView;
  window.setTimeout = function(code, delay, arguments) {};
  window.setInterval = function(code, delay, arguments) {};
  anychartify(rootDoc);

  return rootDoc
}
934652
public function run($webroot) {
        $this->_webroot = $webroot;
        $this->getRequest()->set('webroot', $webroot);

        // Create symlinks
        $this->createLinks($webroot);

        // Dispatch request
        $this->emit('mvc.preRun', [$this]);

        $dispatcher = $this->getDispatcher();
        $dispatcher->setApplication($this);
        $dispatcher->setParams($this->getRouter()->current()->getParams());
        $dispatcher->setRequest($this->getRequest());
        $dispatcher->setResponse($this->getResponse());

        $response = $dispatcher->dispatch();

        $this->emit('mvc.postRun', [$this]);

        // Output response
        $this->getResponse()->body($response)->respond();

        $this->emit('mvc.onShutdown', [$this]);
        exit();
    }
386654
public void setRoot(int root)
  {
    // %OPT% Get this directly from the lpi.
    XPathContext xctxt = wi().getXPathContext();
    m_dtm = xctxt.getDTM(root);
    m_traverser = m_dtm.getAxisTraverser(m_axis);
    m_isFresh = true;
    m_foundLast = false;
    m_root = root;
    m_currentNode = root;

    if (DTM.NULL == root)
    {
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!");
    }

    resetProximityPositions();
  }
753887
protected function setConnectionRoot()
	{
		$root = $this->getRoot();

		if (!$root) {
			return;
		}

		if (!$this->root = @\ssh2_sftp_realpath($this->sftp, $root)) {
			throw new \RuntimeException('Root is invalid or does not exist: ' . $root);
		}

		$this->root = $root . $this->separator;
	}
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");
        }
    }
161798
public function setPath(File $path) {
		$this->path = $path;
		if ($this->isCreateIfNotExists() && !$path->isFile()) {
			$path->getParent()->mkdir();
			$path->write("");
			$this->setCreateDefault(true);
			if (!$path->isFile()) {
				throw new FileNotFoundException($path);
			}
		}
		$this->content = $path->getContent();
	}
875965
public function setRelativeAssetsPath($path) {

	    $path = trim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');

	    if($path) {
	        $path .= '/';
        }

		$this->relativeAssetsPath =  $path;
		return $this;

	}
1078106
public void setRoot(int context, Object environment)
  {

    m_context = context;
    
    XPathContext xctxt = (XPathContext)environment;
    m_execContext = xctxt;
    m_cdtm = xctxt.getDTM(context);
    
    m_currentContextNode = context; // only if top level?
    
    // Yech, shouldn't have to do this.  -sb
    if(null == m_prefixResolver)
    	m_prefixResolver = xctxt.getNamespaceContext();
        
    m_lastFetched = DTM.NULL;
    m_foundLast = false;
    m_pos = 0;
    m_length = -1;

    if (m_isTopLevel)
      this.m_stackFrame = xctxt.getVarStack().getStackFrame();
      
    // reset();
  }