1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ways to leave addon data while addon uninstall

Discussion in 'XenForo Development Discussions' started by xf_phantom, Aug 10, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    What would be the best way to do to implement a OPTIONAL feature, to NOT delete the custom addon data (tables)


    PHP:
      protected function _postDelete()
       {
         if (
    $this->get('uninstall_callback_class') && $this->get('uninstall_callback_method'))
         {
           
    call_user_func(
             array(
    $this->get('uninstall_callback_class'), $this->get('uninstall_callback_method')),
             
    $this->getMergedData()
           );
         }

         
    $addOnModel $this->_getAddOnModel();
         
    $addOnModel->deleteAddOnMasterData($this->get('addon_id'));

         
    $addOnModel->rebuildAddOnCaches();
         
    $addOnModel->rebuildActiveAddOnCache();
       }
    because the addon datawriter calls the uninstall callback BEFORE the addon data get deleted i was thinking about a on/off acp option for this.

    Anybody using this already, or an similar way?
     

Share This Page