src/Request.php
public function setRoot($root) {
        $value = trim($root, '/');
        if ($value) {
            $value = '/'.$value;
        }
        $this->env['SCRIPT_NAME'] = $value;
        return $this;
    }
public function setRoot($root) {
        $value = trim($root, '/');
        if ($value) {
            $value = '/'.$value;
        }
        $this->env['SCRIPT_NAME'] = $value;
        return $this;
    }
Set the root directory (SCRIPT_NAME) of the request.

This method will modify the set root to include a leading slash if it does not have one.
A root of just "/" will be coerced to an empty string.

@param string $root The new root directory.
@return Request Returns $this for fluent calls.
@see Request::getRoot()