Esempio n. 1
0
 private static function uninstallCustomized()
 {
     $db = XenForo_Application::getDb();
     $db->query("DELETE FROM `xf_content_type` WHERE addon_id = ?", array('bdApiConsumer'));
     $db->query("DELETE FROM `xf_content_type_field` WHERE content_type = ?", array('bdapi_consumer'));
     $db->query("DELETE FROM `xf_user_alert` WHERE content_type = ?", array('bdapi_consumer'));
     $db->query("DELETE FROM `xf_user_alert_optout` WHERE alert LIKE 'bdapiconsumer_%s'");
     XenForo_Model::create('XenForo_Model_ContentType')->rebuildContentTypeCache();
     bdApiConsumer_ShippableHelper_Updater::onUninstall(bdApiConsumer_Option::UPDATER_URL);
 }
Esempio n. 2
0
 public static function init_dependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
 {
     XenForo_Template_Helper_Core::$helperCallbacks['bdapiconsumer_getoption'] = array('bdApiConsumer_Option', 'get');
     XenForo_Template_Helper_Core::$helperCallbacks['bdapiconsumer_getprovidersdkjs'] = array('bdApiConsumer_Helper_Template', 'getProviderSdkJs');
     if (bdApiConsumer_Option::get('takeOver', 'register')) {
         $options = XenForo_Application::getOptions();
         $options->set('registrationSetup', 'enabled', 0);
         $options->set('bdapi_consumer_bypassRegistrationActive', 1);
     }
     if (bdApiConsumer_Option::get('takeOver', 'avatar')) {
         bdApiConsumer_Helper_Avatar::setupHelper();
     }
     bdApiConsumer_ShippableHelper_Updater::onInitDependencies($dependencies, bdApiConsumer_Option::UPDATER_URL);
 }
Esempio n. 3
0
 /**
  * Bootstraps the Updater.
  * This routine cannot be executed at `init_dependencies` due to version resolving,
  * it will run at `front_controller_pre_route` instead. This method should only be called once
  * for each <code>$config.apiUrl</code.
  *
  * @param array $config
  *
  * @internal
  */
 public static function bootstrap(array $config)
 {
     if (isset($GLOBALS[self::KEY]['setupMethod'][$config['apiUrl']])) {
         if (XenForo_Application::debugMode()) {
             die(sprintf('Updater for %s has been setup by %s already!', $config['apiUrl'], $GLOBALS[self::KEY]['setupMethod'][$config['apiUrl']]));
         }
         return;
     }
     $GLOBALS[self::KEY]['setupMethod'][$config['apiUrl']] = __METHOD__;
     if (self::$_config !== null) {
         if (XenForo_Application::debugMode()) {
             die(sprintf('%s has been setup to run with %s already!', __METHOD__, self::$_config['apiUrl']));
         }
         return;
     }
     self::$_config = $config;
     // from this point, we no longer need to care about other implementations of Updater
     // all checks have been passed and indicated that the current one is the latest version
     XenForo_CodeEvent::addListener('front_controller_pre_view', array(__CLASS__, 'front_controller_pre_view'));
 }