private function performUpdate()
    {
        // Check if everything is ok locally
        if ($this->filesExist()) {
            if ($this->hoursSinceUpdate() < static::UPDATE_INTVL_H) {
                return false;
            }
        }

        $filesUpdated = [];

        // Log FTP diff procedure
        $ftp = $this->ftp();
        foreach (static::FILES as $file) {
            // Local file path
            $lFile = $this->storage($file);

            // Remote and local file sizes
            $rSize = ftp_size($ftp, $file);
            $lSize = file_exists($lFile) ? filesize($lFile) : 0;

            // Check if file sizes differ
            if ($lSize != $rSize) {
                // Download files if the sizes differ
                ftp_get($ftp, $lFile, $file, FTP_ASCII);
                $filesUpdated[] = $file;
            }
        }

        // Flag current last update time to now
        $this->setUpdatedNow();

        return $filesUpdated;
    }
private function performUpdate()
    {
        // Check if everything is ok locally
        if ($this->filesExist()) {
            if ($this->hoursSinceUpdate() < static::UPDATE_INTVL_H) {
                return false;
            }
        }

        $filesUpdated = [];

        // Log FTP diff procedure
        $ftp = $this->ftp();
        foreach (static::FILES as $file) {
            // Local file path
            $lFile = $this->storage($file);

            // Remote and local file sizes
            $rSize = ftp_size($ftp, $file);
            $lSize = file_exists($lFile) ? filesize($lFile) : 0;

            // Check if file sizes differ
            if ($lSize != $rSize) {
                // Download files if the sizes differ
                ftp_get($ftp, $lFile, $file, FTP_ASCII);
                $filesUpdated[] = $file;
            }
        }

        // Flag current last update time to now
        $this->setUpdatedNow();

        return $filesUpdated;
    }
private function performUpdate ( ) { // Check if everything is ok locally if ( $ this -> filesExist ( ) ) { if ( $ this -> hoursSinceUpdate ( ) < static :: UPDATE_INTVL_H ) { return false ; } } $ filesUpdated = [ ] ; // Log FTP diff procedure $ ftp = $ this -> ftp ( ) ; foreach ( static :: FILES as $ file ) { // Local file path $ lFile = $ this -> storage ( $ file ) ; // Remote and local file sizes $ rSize = ftp_size ( $ ftp , $ file ) ; $ lSize = file_exists ( $ lFile ) ? filesize ( $ lFile ) : 0 ; // Check if file sizes differ if ( $ lSize != $ rSize ) { // Download files if the sizes differ ftp_get ( $ ftp , $ lFile , $ file , FTP_ASCII ) ; $ filesUpdated [ ] = $ file ; } } // Flag current last update time to now $ this -> setUpdatedNow ( ) ; return $ filesUpdated ; }
Checks if the local files need to be updated and updates them. This
occurs if a local file is missing, or if the update time interval has
been exceeded. While updating local file sizes are compared to remote
file sizes and the files are only updated if they differ in size

@return array|bool An array of files that were updated
@throws \Exception
Checks if the local files need to be updated and updates them . This occurs if a local file is missing or if the update time interval has been exceeded . While updating local file sizes are compared to remote file sizes and the files are only updated if they differ in size