static public function createSplFileInfo($baseDir, $path)
    {
        $absPath = realpath($path);
        $baseDirLen = strlen($baseDir);

        if($baseDir === substr($absPath,0,$baseDirLen)){
            $subPathName = ltrim(substr($absPath,$baseDirLen),'\\/');
            $dir = dirname($subPathName);
            $subPath = '.' === $dir ? '':$dir;
        }else{
            $subPath = $subPathName = '';
        }

        return new SplFileInfo($absPath,$subPath,$subPathName);
    }
static public function createSplFileInfo($baseDir, $path)
    {
        $absPath = realpath($path);
        $baseDirLen = strlen($baseDir);

        if($baseDir === substr($absPath,0,$baseDirLen)){
            $subPathName = ltrim(substr($absPath,$baseDirLen),'\\/');
            $dir = dirname($subPathName);
            $subPath = '.' === $dir ? '':$dir;
        }else{
            $subPath = $subPathName = '';
        }

        return new SplFileInfo($absPath,$subPath,$subPathName);
    }
static public function createSplFileInfo ( $ baseDir , $ path ) { $ absPath = realpath ( $ path ) ; $ baseDirLen = strlen ( $ baseDir ) ; if ( $ baseDir === substr ( $ absPath , 0 , $ baseDirLen ) ) { $ subPathName = ltrim ( substr ( $ absPath , $ baseDirLen ) , '\\/' ) ; $ dir = dirname ( $ subPathName ) ; $ subPath = '.' === $ dir ? '' : $ dir ; } else { $ subPath = $ subPathName = '' ; } return new SplFileInfo ( $ absPath , $ subPath , $ subPathName ) ; }
Generate SplFileInfo from base dir

@param   string $baseDir Base dir for path
@param   string  $path       A file/directory name
@return  SplFileInfo
Generate SplFileInfo from base dir