コード例 #1
0
ファイル: Installer.php プロジェクト: lchen01/STEdwards
 /**
  * Uninstall a plugin.  
  *
  * This will run the 'uninstall' hook for the given plugin, and then it
  * will remove the entry in the DB corresponding to the plugin.
  * 
  * @param Plugin $plugin Plugin to uninstall.
  * @throws Omeka_Plugin_Loader_Exception
  * @return void
  */
 public function uninstall(Plugin $plugin)
 {
     if (!$plugin->isLoaded()) {
         // Flag the plugin as active so we can load the 'uninstall' hook.
         $plugin->setActive(true);
         // Load the plugin files, die if can't be loaded.
         $this->_loader->load($plugin, true);
     }
     $this->_broker->callHook('uninstall', array(), $plugin);
     $plugin->delete();
 }
コード例 #2
0
ファイル: Loader.php プロジェクト: kwiliarty/Omeka
 /**
  * Loads the plugin bootstrap file for a plugin.
  *
  * @param Plugin $plugin
  * @return void
  */
 protected function _loadPluginBootstrap(Plugin $plugin)
 {
     $pluginDirName = $plugin->getDirectoryName();
     $this->_broker->setCurrentPluginDirName($pluginDirName);
     // Bootstrap plugin.php if it exists.
     $pluginFilePath = $this->getPluginFilePath($pluginDirName);
     if (file_exists($pluginFilePath)) {
         require $pluginFilePath;
         // Otherwise bootstrap the plugin class.
     } else {
         require_once $this->getPluginClassFilePath($pluginDirName);
         $pluginClassName = $this->getPluginClassName($pluginDirName);
         $pluginClass = new $pluginClassName();
         $pluginClass->setUp();
     }
     // Reset the current plugin.
     $this->_broker->setCurrentPluginDirName(null);
 }