public static function fileInfo(String $dir, String $extension = NULL) : Array
    {
        $dir = self::rpath($dir);

        if( is_dir($dir) )
        {
            $files = FileList::files($dir, $extension);

            $dir = Base::suffix($dir);

            $filesInfo = [];

            foreach( $files as $file )
            {
                $filesInfo[$file]['basename']   = self::pathInfo($dir.$file, 'basename');
                $filesInfo[$file]['size']       = filesize($dir.$file);
                $filesInfo[$file]['date']       = filemtime($dir.$file);
                $filesInfo[$file]['readable']   = is_readable($dir.$file);
                $filesInfo[$file]['writable']   = is_writable($dir.$file);
                $filesInfo[$file]['executable'] = is_executable($dir.$file);
                $filesInfo[$file]['permission'] = fileperms($dir.$file);
            }

            return $filesInfo;
        }
        elseif( is_file($dir) )
        {
            return (array) self::get($dir);
        }
        else
        {
            throw new Exception\FolderNotFoundException(NULL, $dir);
        }
    }
public static function fileInfo(String $dir, String $extension = NULL) : Array
    {
        $dir = self::rpath($dir);

        if( is_dir($dir) )
        {
            $files = FileList::files($dir, $extension);

            $dir = Base::suffix($dir);

            $filesInfo = [];

            foreach( $files as $file )
            {
                $filesInfo[$file]['basename']   = self::pathInfo($dir.$file, 'basename');
                $filesInfo[$file]['size']       = filesize($dir.$file);
                $filesInfo[$file]['date']       = filemtime($dir.$file);
                $filesInfo[$file]['readable']   = is_readable($dir.$file);
                $filesInfo[$file]['writable']   = is_writable($dir.$file);
                $filesInfo[$file]['executable'] = is_executable($dir.$file);
                $filesInfo[$file]['permission'] = fileperms($dir.$file);
            }

            return $filesInfo;
        }
        elseif( is_file($dir) )
        {
            return (array) self::get($dir);
        }
        else
        {
            throw new Exception\FolderNotFoundException(NULL, $dir);
        }
    }
public static function fileInfo ( String $ dir , String $ extension = NULL ) : Array { $ dir = self :: rpath ( $ dir ) ; if ( is_dir ( $ dir ) ) { $ files = FileList :: files ( $ dir , $ extension ) ; $ dir = Base :: suffix ( $ dir ) ; $ filesInfo = [ ] ; foreach ( $ files as $ file ) { $ filesInfo [ $ file ] [ 'basename' ] = self :: pathInfo ( $ dir . $ file , 'basename' ) ; $ filesInfo [ $ file ] [ 'size' ] = filesize ( $ dir . $ file ) ; $ filesInfo [ $ file ] [ 'date' ] = filemtime ( $ dir . $ file ) ; $ filesInfo [ $ file ] [ 'readable' ] = is_readable ( $ dir . $ file ) ; $ filesInfo [ $ file ] [ 'writable' ] = is_writable ( $ dir . $ file ) ; $ filesInfo [ $ file ] [ 'executable' ] = is_executable ( $ dir . $ file ) ; $ filesInfo [ $ file ] [ 'permission' ] = fileperms ( $ dir . $ file ) ; } return $ filesInfo ; } elseif ( is_file ( $ dir ) ) { return ( array ) self :: get ( $ dir ) ; } else { throw new Exception \ FolderNotFoundException ( NULL , $ dir ) ; } }
Used to get various information about a file or directory.

@param string $dir
@param string $extension = NULL

@return array
Used to get various information about a file or directory .