Exemple #1
0
 public function execute(array $deferred, array $data, $targetRunTime, &$status)
 {
     if (isset($data['install']) && $data['install']) {
         $result = ThemeHouse_Install::postInstall($data, $targetRunTime, $status);
     } elseif (isset($data['uninstall']) && $data['uninstall']) {
         $result = ThemeHouse_Install::postUninstall($data, $targetRunTime, $status);
     } else {
         $result = true;
     }
     if ($result === true) {
         return false;
     } else {
         return $data;
     }
 }
Exemple #2
0
 protected function _checkJustInstalled()
 {
     $justInstalled = XenForo_Application::getSimpleCacheData(self::JUST_INSTALLED_SIMPLE_CACHE_KEY);
     if ($justInstalled) {
         $db = XenForo_Application::get('db');
         foreach ($justInstalled as $addOnId) {
             if (method_exists('ThemeHouse_Install', 'postInstall')) {
                 if (ThemeHouse_Install::postInstall(array('addon_id' => $addOnId)) === false) {
                     return false;
                 }
             }
             if (XenForo_Application::$versionId < 1020000) {
                 $db->delete('xf_code_event_listener', 'addon_id = ' . $db->quote($addOnId) . ' AND event_id = \'load_class\'');
                 $db->update('xf_code_event_listener', array('active' => 1), 'addon_id = ' . $db->quote($addOnId) . ' AND event_id LIKE \'load_class_%\'');
                 $db->update('xf_code_event_listener', array('active' => 1), 'addon_id = ' . $db->quote($addOnId) . ' AND event_id LIKE \'template_%\'');
             }
         }
         if (XenForo_Application::$versionId < 1020000) {
             /* @var $codeEventModel XenForo_Model_CodeEvent */
             $codeEventModel = $this->getModelFromCache('XenForo_Model_CodeEvent');
             $codeEventModel->rebuildEventListenerCache();
         }
         XenForo_Application::setSimpleCacheData(self::JUST_INSTALLED_SIMPLE_CACHE_KEY, array());
     }
 }