public function getAllDownloads ()
    {
        try
        {
            $directoryIterator = new \DirectoryIterator($this->downloadDir);
            $downloads         = [];

            foreach ($directoryIterator as $file)
            {
                if (!$file->isFile())
                {
                    continue;
                }

                // skip hidden files
                if ("." === $file->getBasename()[0])
                {
                    continue;
                }

                $downloads[$file->getFilename()] = new Download($file, self::RELATIVE_DOWNLOAD_DIR);
            }

            ksort($downloads);
            return $downloads;
        }
        catch (\UnexpectedValueException $e)
        {
            return [];
        }
    }
public function getAllDownloads ()
    {
        try
        {
            $directoryIterator = new \DirectoryIterator($this->downloadDir);
            $downloads         = [];

            foreach ($directoryIterator as $file)
            {
                if (!$file->isFile())
                {
                    continue;
                }

                // skip hidden files
                if ("." === $file->getBasename()[0])
                {
                    continue;
                }

                $downloads[$file->getFilename()] = new Download($file, self::RELATIVE_DOWNLOAD_DIR);
            }

            ksort($downloads);
            return $downloads;
        }
        catch (\UnexpectedValueException $e)
        {
            return [];
        }
    }
public function getAllDownloads ( ) { try { $ directoryIterator = new \ DirectoryIterator ( $ this -> downloadDir ) ; $ downloads = [ ] ; foreach ( $ directoryIterator as $ file ) { if ( ! $ file -> isFile ( ) ) { continue ; } // skip hidden files if ( "." === $ file -> getBasename ( ) [ 0 ] ) { continue ; } $ downloads [ $ file -> getFilename ( ) ] = new Download ( $ file , self :: RELATIVE_DOWNLOAD_DIR ) ; } ksort ( $ downloads ) ; return $ downloads ; } catch ( \ UnexpectedValueException $ e ) { return [ ] ; } }
Returns a list of all downloads

@return Download[]
Returns a list of all downloads