src/Path.php
/**
     * Check if a given path is ancestor of the another path.
     *
     * Return true if the input path is ancestor of the comparison
     *
     * @param string $path       the path want to check
     * @param string $comparison the target path used for comparison
     *
     * @return bool
     */
Check if a given path is ancestor of the another path.
Return true if the input path is ancestor of the comparison

@param string $path       the path want to check
@param string $comparison the target path used for comparison

@return bool
Check if a given path is ancestor of the another path . Return true if the input path is ancestor of the comparison @param string $path the path want to check @param string $comparison the target path used for comparison @return bool
public static function isAncestor($path, $comparison)
    {
        $ancestor   = static::absolute($path);
        $descendant = static::absolute($comparison);
        return substr($descendant, 0, strlen($ancestor)) === $ancestor;
    }
public static function isAncestor ( $ path , $ comparison ) { $ ancestor = static :: absolute ( $ path ) ; $ descendant = static :: absolute ( $ comparison ) ; return substr ( $ descendant , 0 , strlen ( $ ancestor ) ) === $ ancestor ; }
Check if a given path is ancestor of the another path.
Check if a given path is ancestor of the another path .