Esempio n. 1
0
 /**
  * VQMod::_getMods()
  *
  * @return null
  * @description Gets list of XML files in vqmod xml folder for processing
  */
 private static function _getMods()
 {
     self::$_modFileList = glob(self::path('vqmod/xml/', true) . '*.xml');
     foreach (self::$_modFileList as $file) {
         if (file_exists($file)) {
             $lastMod = filemtime($file);
             if ($lastMod > self::$_lastModifiedTime) {
                 self::$_lastModifiedTime = $lastMod;
             }
         }
     }
     $xml_folder_time = filemtime(self::path('vqmod/xml'));
     if ($xml_folder_time > self::$_lastModifiedTime) {
         self::$_lastModifiedTime = $xml_folder_time;
     }
     $modCache = self::path(self::$modCache);
     if (self::$_devMode || !file_exists($modCache)) {
         self::$_lastModifiedTime = time();
     } elseif (file_exists($modCache) && filemtime($modCache) >= self::$_lastModifiedTime) {
         $mods = file_get_contents($modCache);
         if (!empty($mods)) {
             self::$_mods = unserialize($mods);
         }
         if (self::$_mods !== false) {
             return;
         }
     }
     if (self::$_modFileList) {
         self::_parseMods();
     } else {
         self::$log->write('VQMod::_getMods - NO XML FILES READABLE IN XML FOLDER');
     }
 }