> ------------------------------------------------------------------------------ See main.inc.php for release information ASE_Install : classe to manage plugin install --------------------------------------------------------------------------- */ include_once('ase_version.inc.php'); // => Don't forget to update this file !! include_once('ase_root.class.inc.php'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php'); /* ASE class for install process */ class ASE_Install extends ASE_root { public function __construct($prefixeTable, $filelocation) { parent::__construct($prefixeTable, $filelocation); } public function __destruct() { parent::__destruct(); } /* function for installation process return true if install process is ok, otherwise false */ public function install() { $this->initConfig(); $this->loadConfig(); $this->config['installed']=ASE_VERSION2; $this->config['newInstall']='y'; $this->saveConfig(); GPCCore::register($this->getPluginName(), ASE_VERSION, ASE_GPC_NEEDED); return(true); } /* function for uninstall process */ public function uninstall() { $this->deleteConfig(); GPCCore::unregister($this->getPluginName()); return(''); } public function activate() { $this->initConfig(); $this->loadConfig(); /* * migration code */ switch($this->config['installed']) { // actually, there no migration possible from previous release default: // nothing to do... break; } $this->config['installed']=ASE_VERSION2; $this->saveConfig(); GPCCore::register($this->getPluginName(), ASE_VERSION, ASE_GPC_NEEDED); GPCRequestBuilder::register('ASETag', dirname($this->getFileLocation()).'/ase_rb_callback_tag.class.inc.php'); GPCRequestBuilder::register('ASEDate', dirname($this->getFileLocation()).'/ase_rb_callback_date.class.inc.php'); GPCRequestBuilder::register('ASECategory', dirname($this->getFileLocation()).'/ase_rb_callback_category.class.inc.php'); GPCRequestBuilder::register('ASEKeyword', dirname($this->getFileLocation()).'/ase_rb_callback_keyword.class.inc.php'); GPCRequestBuilder::register('ASERate', dirname($this->getFileLocation()).'/ase_rb_callback_rate.class.inc.php'); GPCRequestBuilder::unregister('ASEHD'); // need to be keeped to be able to unregister it... return(''); } public function deactivate() { GPCRequestBuilder::unregister('ASETag'); GPCRequestBuilder::unregister('ASEDate'); GPCRequestBuilder::unregister('ASECategory'); GPCRequestBuilder::unregister('ASEKeyword'); GPCRequestBuilder::unregister('ASERate'); GPCRequestBuilder::unregister('ASEHD'); // need to be keeped to be able to unregister it... } } //class ?>