Changeset 10264 for extensions/AStat/maintain.inc.php
- Timestamp:
- Apr 10, 2011, 10:07:47 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/maintain.inc.php
r5546 r10264 17 17 if(!defined('ASTAT_PATH')) define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/'); 18 18 19 include_once('astat_version.inc.php'); 19 include_once('astat_version.inc.php'); // => Don't forget to update this file !! 20 20 21 //ini_set('error_reporting', E_ALL);22 //ini_set('display_errors', true);23 21 24 global $gpc _installed, $gpcNeeded, $lang; //needed for plugin manager compatibility22 global $gpcInstalled, $lang; //needed for plugin manager compatibility 25 23 26 24 /* ----------------------------------------------------------------------------- 27 AStat -2needs the Grum Plugin Classe25 AStat needs the Grum Plugin Classe 28 26 ----------------------------------------------------------------------------- */ 29 $gpc_installed=false; 30 $gpcNeeded="3.0.0"; 27 $gpcInstalled=false; 31 28 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 32 29 { 33 30 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 34 // need GPC release greater or equal than 3. 0.035 if(CommonPlugin::checkGPCRelease( 3,0,0))31 // need GPC release greater or equal than 3.5.0 32 if(CommonPlugin::checkGPCRelease(ASTAT_GPC_NEEDED)) 36 33 { 37 @include_once("astat_aim.class.inc.php");38 $gpc _installed=true;34 include_once("astat_install.class.inc.php"); 35 $gpcInstalled=true; 39 36 } 40 37 } … … 42 39 function gpcMsgError(&$errors) 43 40 { 44 global $gpcNeeded; 45 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 41 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), ASTAT_GPC_NEEDED); 46 42 if(is_array($errors)) 47 43 { … … 56 52 57 53 54 58 55 load_language('plugin.lang', ASTAT_PATH); 56 57 58 59 59 60 60 function plugin_install($plugin_id, $plugin_version, &$errors) 61 61 { 62 global $prefixeTable, $gpc _installed, $gpcNeeded;63 if($gpc _installed)62 global $prefixeTable, $gpcInstalled; 63 if($gpcInstalled) 64 64 { 65 $obj = new AStat_AIM($prefixeTable, __FILE__); 66 $obj->deleteConfig(); 67 $obj->initConfig(); 68 $obj->my_config['installed']=ASTAT_VERSION2; 69 $obj->saveConfig(); 70 GPCCore::register($obj->getPluginName(), ASTAT_VERSION, $gpcNeeded); 65 $obj=new AStat_install($prefixeTable, __FILE__); 66 $result=$obj->install(); 71 67 } 72 68 else … … 78 74 function plugin_activate($plugin_id, $plugin_version, &$errors) 79 75 { 80 global $prefixeTable, $gpc _installed;81 if($gpc _installed)76 global $prefixeTable, $gpcInstalled; 77 if($gpcInstalled) 82 78 { 83 $obj = new AStat_AIM($prefixeTable, __FILE__); 84 $obj->initConfig(); 85 $obj->loadConfig(); 86 $obj->my_config['installed']=ASTAT_VERSION2; 87 $obj->saveConfig(); 88 $obj->alter_history_section_enum('deleted_cat'); 89 } 90 else 91 { 92 gpcMsgError($errors); 79 $obj=new AStat_install($prefixeTable, __FILE__); 80 $result=$obj->activate(); 93 81 } 94 82 } … … 96 84 function plugin_deactivate($plugin_id) 97 85 { 86 global $prefixeTable, $gpcInstalled; 87 88 if($gpcInstalled) 89 { 90 $obj=new AStat_install($prefixeTable, __FILE__); 91 $obj->deactivate(); 92 } 98 93 } 99 94 100 95 function plugin_uninstall($plugin_id) 101 96 { 102 global $prefixeTable, $gpc _installed;103 if($gpc _installed)97 global $prefixeTable, $gpcInstalled; 98 if($gpcInstalled) 104 99 { 105 $obj = new AStat_AIM($prefixeTable, __FILE__); 106 $obj->deleteConfig(); 107 GPCCore::unregister($obj->getPluginName()); 100 $obj=new AStat_install($prefixeTable, __FILE__); 101 $result=$obj->uninstall(); 108 102 } 109 103 else … … 115 109 116 110 111 112 117 113 ?>
Note: See TracChangeset
for help on using the changeset viewer.