public function getProjectRoot()
    {
        $base = '';
        $files = array_keys($this->getArrayCopy());
        $parts = explode(DIRECTORY_SEPARATOR, reset($files));

        foreach ($parts as $part) {
            $base_part = $base . $part . DIRECTORY_SEPARATOR;
            foreach ($files as $dir) {
                if (substr($dir, 0, strlen($base_part)) != $base_part) {
                    return $base;
                }
            }

            $base = $base_part;
        }

        return $base;
    }
public function getProjectRoot()
    {
        $base = '';
        $files = array_keys($this->getArrayCopy());
        $parts = explode(DIRECTORY_SEPARATOR, reset($files));

        foreach ($parts as $part) {
            $base_part = $base . $part . DIRECTORY_SEPARATOR;
            foreach ($files as $dir) {
                if (substr($dir, 0, strlen($base_part)) != $base_part) {
                    return $base;
                }
            }

            $base = $base_part;
        }

        return $base;
    }
public function getProjectRoot ( ) { $ base = '' ; $ files = array_keys ( $ this -> getArrayCopy ( ) ) ; $ parts = explode ( DIRECTORY_SEPARATOR , reset ( $ files ) ) ; foreach ( $ parts as $ part ) { $ base_part = $ base . $ part . DIRECTORY_SEPARATOR ; foreach ( $ files as $ dir ) { if ( substr ( $ dir , 0 , strlen ( $ base_part ) ) != $ base_part ) { return $ base ; } } $ base = $ base_part ; } return $ base ; }
Calculates the project root from the given files by determining their
highest common path.

@return string
Calculates the project root from the given files by determining their highest common path .