/** * Check and load the files if necessary. * * @param string $sFileNamePath A pH7Framework filename path. * @return void */ private function _loadFile($sFileNamePath) { $oFile = new File(); $sFullPath = PH7_PATH_FRAMEWORK . $sFileNamePath; $bIsExpiredFile = VDate::setTime('-2 months') > $oFile->getModifTime($sFullPath); $bFileExists = $oFile->existFile($sFullPath); $bIsTooSmallFile = $oFile->size($sFullPath) < 1000; if (!$bFileExists || $bIsTooSmallFile || $bIsExpiredFile) { if ($bFileExists) { // Delete the file if it already exists $oFile->deleteFile($sFullPath); } $this->_downloadFile($sFileNamePath, $oFile); } unset($oFile); }