[geeklog-cvs] Geeklog-1.x/plugins/staticpages functions.inc, 1.117, 1.118

Dirk Haun dhaun at qs1489.pair.com
Mon Mar 17 17:12:57 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/staticpages
In directory qs1489.pair.com:/tmp/cvs-serv17216/staticpages

Modified Files:
	functions.inc 
Log Message:
Plugins are updated by the install script, so we don't need to maintain the plugin's upgrade function


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/staticpages/functions.inc,v
retrieving revision 1.117
retrieving revision 1.118
diff -C2 -d -r1.117 -r1.118
*** functions.inc	16 Mar 2008 09:33:23 -0000	1.117
--- functions.inc	17 Mar 2008 21:12:54 -0000	1.118
***************
*** 1031,1076 ****
  *
  */
! function plugin_upgrade_staticpages ()
  {
!     global $_CONF, $_TABLES, $_SP_CONF, $plugin_path;
! 
!     // the plugin needs this function so complain when it doesn't exist
!     if (!function_exists('SEC_getGroupDropdown')) {
          return 3002;
      }
  
!     $pi_version = DB_getItem($_TABLES['plugins'], 'pi_version',
!                              "pi_name = 'staticpages'");
! 
!     if ($pi_version == '1.4.3') { // Need to initialize the config table
! 
!         require_once $_CONF['path_system'] . 'classes/config.class.php';
!         require_once $plugin_path . 'install_defaults.php';
! 
!         if (!plugin_initconfig_staticpages()) {
!             COM_errorLog("Staticpages upgrade to 1.5.0 failed");
!             return 3001;
!         }
! 
!         if (file_exists($plugin_path . 'config.php')) {
!             // Rename the existing config.php as it's not needed any more
!             $ren = @rename($plugin_path . 'config.php',
!                            $plugin_path . 'config-pre1.5.0.php');
!             if (!$ren) {
!                 COM_errorLog("Could not rename the Static Pages plugin's config.php file. Please remove if manually, as it is not needed any more.");
!             }
!         }
! 
!         $sp_config = config::get_instance();
!         if ($sp_config->group_exists('staticpages')) {
!             DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.5.0', pi_gl_version = '1.5.0' WHERE pi_name = 'staticpages'");
!         } else {
!             COM_errorLog("Staticpages upgrade to 1.5.0 failed");
!             return 3001;
!         }
! 
!     }
! 
!     return true;
  }
  
--- 1031,1045 ----
  *
  */
! function plugin_upgrade_staticpages()
  {
!     // the plugin needs these function so complain when they don't exist
!     if (!function_exists('PLG_uninstall') ||
!             !function_exists('COM_createLink')) {
          return 3002;
      }
  
!     // upgrades are done by the install script - return a generic error
!     COM_errorLog("Plugin upgrade function not implemented");
!     return 3001;
  }
  




More information about the geeklog-cvs mailing list