Esempio n. 1
0
 private function _oneExtension($wid = 0)
 {
     $folder = WExtension::get($wid, 'folder');
     $component = 'com_' . $folder;
     $joomlaExtensionsM = WModel::get('joomla.extensions');
     $joomlaExtensionsM->whereE('type', 'component');
     $joomlaExtensionsM->whereE('element', $component);
     $id = $joomlaExtensionsM->load('lr', 'extension_id');
     $joomlaExtensionsM = WModel::get('joomla.extensions');
     $joomlaExtensionsM->whereE('extension_id', $id);
     $joomlaExtensionsM->delete();
     $joomlaMenuM = WModel::get('joomla.menu');
     $joomlaMenuM->whereE('component_id', $id);
     $joomlaMenuM->delete();
     $assetsT = WTable::get('assets');
     $assetsT->whereE('name', $component);
     $assetsT->delete();
     $folderS = WGet::folder();
     $folderS->delete(JOOBI_DS_ADMIN . $component);
     $folderS->delete(JOOBI_DS_ROOT . 'components' . DS . $component);
 }
Esempio n. 2
0
 /**
  * Patch up all work related to JOOBI_MAIN_APP application
  */
 private function _MainAppPatch($appID)
 {
     try {
         $this->_joobiInfoLog("_MainAppPatch()");
         $mainAppID = WExtension::get(JOOBI_MAIN_APP . '.application', 'wid');
         if (!empty($mainAppID) && $appID != $mainAppID) {
             $this->_updateVersionAndTime($mainAppID);
         }
         // this to make sure we don not publish JOOBI_MAIN_APP when we install say a app like jlinks only on a fresh install
         // joomla specific
         if ($this->cmsName == 'joomla') {
             $extensionsJoomlaM = WModel::get('joomla.extensions');
             $extensionsJoomlaM->whereE('element', 'com_' . JOOBI_MAIN_APP);
             $extensionsJoomlaM->whereE('type', 'component');
             $extensionId = $extensionsJoomlaM->load('lr', 'extension_id');
             // if JOOBI_MAIN_APP is not present in joomla table , it means it has not been installed previous to this innstallation pf app XYZ
             if (empty($extensionId) && !empty($mainAppID) && $appID != $mainAppID) {
                 $appsM = WModel::get('apps');
                 $appsM->setVal('publish', 0);
                 $appsM->setVal('modified', time());
                 $appsM->whereE('wid', $mainAppID);
                 $appsM->update();
             }
             //endif
         } else {
             if ($this->cmsName == 'wordpress') {
                 // TODO;
             }
         }
     } catch (Exception $e) {
         throw new Exception("JOOBI_MAIN_APP patching has some issue");
     }
     //trycatch
 }