src/Application.php
public function getRootDir()
    {
        if (!$this->rootDir) {
            $refl = new \ReflectionObject($this);
            $filename = $refl->getFileName();
            if (false !== ($pos = strrpos($filename, '/vendor/'))) {
                $filename = substr($filename, 0, $pos);
            } else {
                $filename = dirname($filename).'/..';
            }

            $this->rootDir = str_replace('\\', '/', $filename);
        }

        return $this->rootDir;
    }
public function getRootDir()
    {
        if (!$this->rootDir) {
            $refl = new \ReflectionObject($this);
            $filename = $refl->getFileName();
            if (false !== ($pos = strrpos($filename, '/vendor/'))) {
                $filename = substr($filename, 0, $pos);
            } else {
                $filename = dirname($filename).'/..';
            }

            $this->rootDir = str_replace('\\', '/', $filename);
        }

        return $this->rootDir;
    }
Gets the root directory.

@return string