Пример #1
0
 /**
  * uninstall an extension
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @return boolean
  */
 public function uninstall()
 {
     common_Logger::i('Uninstalling ' . $this->extension->getId(), 'UNINSTALL');
     // uninstall possible
     if (is_null($this->extension->getManifest()->getUninstallData())) {
         throw new common_Exception('Problem uninstalling extension ' . $this->extension->getId() . ' : Uninstall not supported');
     }
     // installed?
     if (!common_ext_ExtensionsManager::singleton()->isInstalled($this->extension->getId())) {
         throw new common_Exception('Problem uninstalling extension ' . $this->extension->getId() . ' : Not installed');
     }
     // check dependcies
     if (helpers_ExtensionHelper::isRequired($this->extension)) {
         throw new common_Exception('Problem uninstalling extension ' . $this->extension->getId() . ' : Still required');
     }
     common_Logger::d('uninstall script for ' . $this->extension->getId());
     $this->uninstallScripts();
     // hook
     $this->extendedUninstall();
     common_Logger::d('unregister extension ' . $this->extension->getId());
     $this->unregister();
     // we purge the whole cache.
     $cache = common_cache_FileCache::singleton();
     $cache->purge();
     common_Logger::i('Uninstalled ' . $this->extension->getId());
     return true;
 }