Ejemplo n.º 1
0
 /**
  * Checks if plugin source code was updated, if yes changes the update status in DB
  * 
  * @return void
  */
 public function checkManualUpdates()
 {
     $timestamp = OW::getConfig()->getValue("base", "check_mupdates_ts");
     if (time() - (int) $timestamp < self::MANUAL_UPDATES_CHECK_INTERVAL_IN_SECONDS) {
         return;
     }
     $plugins = $this->pluginDao->findAll();
     $xmlInfo = $this->getPluginsXmlInfo();
     /* @var $plugin BOL_Plugin */
     foreach ($plugins as $plugin) {
         if (!empty($xmlInfo[$plugin->getKey()]) && (int) $plugin->getBuild() < (int) $xmlInfo[$plugin->getKey()]['build']) {
             $plugin->setUpdate(BOL_PluginDao::UPDATE_VAL_MANUAL_UPDATE);
             $this->pluginDao->save($plugin);
         }
     }
     OW::getConfig()->saveConfig("base", "check_mupdates_ts", time());
 }
Ejemplo n.º 2
0
 public function checkManualUpdates()
 {
     if (defined('OW_PLUGIN_XP')) {
         return;
     }
     $timestamp = OW::getConfig()->getValue('base', 'check_mupdates_ts');
     if (time() - (int) $timestamp < 30) {
         return;
     }
     $plugins = $this->pluginDao->findAll();
     $xmlInfo = $this->getPluginsXmlInfo();
     /* @var $plugin BOL_Plugin */
     foreach ($plugins as $plugin) {
         if (!empty($xmlInfo[$plugin->getKey()]) && (int) $plugin->getBuild() < (int) $xmlInfo[$plugin->getKey()]['build']) {
             $plugin->setUpdate(2);
             $this->pluginDao->save($plugin);
         }
     }
     OW::getConfig()->saveConfig('base', 'check_mupdates_ts', time());
 }