Changeset 5546 for extensions/AStat/maintain.inc.php
- Timestamp:
- Apr 1, 2010, 9:04:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/maintain.inc.php
r5425 r5546 17 17 if(!defined('ASTAT_PATH')) define('ASTAT_PATH' , PHPWG_PLUGINS_PATH . ASTAT_DIR . '/'); 18 18 19 include_once('astat_version.inc.php'); 20 19 21 //ini_set('error_reporting', E_ALL); 20 22 //ini_set('display_errors', true); 21 23 22 global $gpc_installed, $ lang; //needed for plugin manager compatibility24 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 23 25 24 26 /* ----------------------------------------------------------------------------- … … 26 28 ----------------------------------------------------------------------------- */ 27 29 $gpc_installed=false; 28 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 30 $gpcNeeded="3.0.0"; 31 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 29 32 { 30 @include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/main.inc.php');31 // need GPC release greater or equal than 2.0.532 if( checkGPCRelease(2,0,5))33 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 34 // need GPC release greater or equal than 3.0.0 35 if(CommonPlugin::checkGPCRelease(3,0,0)) 33 36 { 34 37 @include_once("astat_aim.class.inc.php"); … … 39 42 function gpcMsgError(&$errors) 40 43 { 41 array_push($errors, sprintf(l10n('AStat_gpc2_not_installed'), "2.0.5")); 44 global $gpcNeeded; 45 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 46 if(is_array($errors)) 47 { 48 array_push($errors, $msg); 49 } 50 else 51 { 52 $errors=Array($msg); 53 } 42 54 } 43 55 // ----------------------------------------------------------------------------- … … 48 60 function plugin_install($plugin_id, $plugin_version, &$errors) 49 61 { 50 global $prefixeTable, $gpc_installed ;62 global $prefixeTable, $gpc_installed, $gpcNeeded; 51 63 if($gpc_installed) 52 64 { 53 65 $obj = new AStat_AIM($prefixeTable, __FILE__); 54 $obj->delete_config(); 55 $obj->init_config(); 56 $obj->save_config(); 66 $obj->deleteConfig(); 67 $obj->initConfig(); 68 $obj->my_config['installed']=ASTAT_VERSION2; 69 $obj->saveConfig(); 70 GPCCore::register($obj->getPluginName(), ASTAT_VERSION, $gpcNeeded); 57 71 } 58 72 else … … 68 82 { 69 83 $obj = new AStat_AIM($prefixeTable, __FILE__); 70 $obj->init_config(); 71 $obj->load_config(); 72 $obj->save_config(); 84 $obj->initConfig(); 85 $obj->loadConfig(); 86 $obj->my_config['installed']=ASTAT_VERSION2; 87 $obj->saveConfig(); 73 88 $obj->alter_history_section_enum('deleted_cat'); 74 89 } … … 89 104 { 90 105 $obj = new AStat_AIM($prefixeTable, __FILE__); 91 $obj->delete_config(); 106 $obj->deleteConfig(); 107 GPCCore::unregister($obj->getPluginName()); 92 108 } 93 109 else
Note: See TracChangeset
for help on using the changeset viewer.