Ejemplo n.º 1
0
 public function execute(array $deferred, array $data, $targetRunTime, &$status)
 {
     if (isset($data['install']) && $data['install']) {
         $result = Waindigo_Install::postInstall($data, $targetRunTime, $status);
     } elseif (isset($data['uninstall']) && $data['uninstall']) {
         $result = Waindigo_Install::postUninstall($data, $targetRunTime, $status);
     } else {
         $result = true;
     }
     if ($result === true) {
         return false;
     } else {
         return $data;
     }
 }
Ejemplo n.º 2
0
 /**
  *
  * @param string $tableName
  * @return boolean
  */
 protected final function _isTableExists($tableName)
 {
     if (!self::$_tablesList) {
         self::$_tablesList = array_map('strtolower', $this->_db->listTables());
     }
     return in_array(strtolower($tableName), self::$_tablesList);
 }
Ejemplo n.º 3
0
 /**
  *
  * @see Waindigo_NoForo_Model_NoForo::rebuildForum()
  */
 public function rebuildForum()
 {
     parent::rebuildForum();
     // TODO: probably don't need to rebuild the entire add-on
     Waindigo_Install::install(array(), array('addon_id' => 'Waindigo_CustomFields'));
 }
Ejemplo n.º 4
0
 protected function _checkJustUninstalled()
 {
     $justUninstalled = XenForo_Application::getSimpleCacheData(self::JUST_UNINSTALLED_SIMPLE_CACHE_KEY);
     if ($justUninstalled) {
         $db = XenForo_Application::get('db');
         foreach ($justUninstalled as $addOnId) {
             if (method_exists('Waindigo_Install', 'postUninstall')) {
                 if (Waindigo_Install::postUninstall(array('addon_id' => $addOnId)) === false) {
                     return false;
                 }
             }
         }
         XenForo_Application::setSimpleCacheData(self::JUST_UNINSTALLED_SIMPLE_CACHE_KEY, array());
     }
 }
Ejemplo n.º 5
0
 /**
  *
  * @see XenForo_Model_AddOn::installAddOnXml()
  */
 public function installAddOnXml(SimpleXMLElement $xml, $upgradeAddOnId = false)
 {
     $installed = parent::installAddOnXml($xml, $upgradeAddOnId);
     if ($installed) {
         $addOnId = (string) $xml['addon_id'];
         if ($addOnId == 'XenResource') {
             // TODO: probably don't need to rebuild the entire add-on
             Waindigo_Install::install(array(), array('addon_id' => 'Waindigo_CustomFields'));
         }
     }
 }