Ignore:
Timestamp:
Mar 25, 2011, 6:09:55 PM (14 years ago)
Author:
Eric
Message:

Renaming plugin directory from NBC_UserAdvManager to UserAdvManager on plugin upgrade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/include/upgradedb.inc.php

    r9846 r9853  
    354354LIMIT 1
    355355;';
    356  
    357   pwg_query($query);
     356
     357  pwg_query($query);
     358
     359  // Create new UAM entry in plugins table
     360  $query = '
     361INSERT INTO '.PLUGINS_TABLE.' (id, state, version)
     362VALUES ("UserAdvManager","active","'.$uam_new_version.'")
     363;';
     364 
     365  pwg_query($query);
     366
     367  // Delete old plugin entry in plugins table
     368  $query = '
     369DELETE FROM '.PLUGINS_TABLE.'
     370WHERE id="NBC_UserAdvManager"
     371LIMIT 1
     372;';
     373 
     374  pwg_query($query);
     375
     376  // rename directory
     377  if (!rename(PHPWG_PLUGINS_PATH.'NBC_UserAdvManager', PHPWG_PLUGINS_PATH.'UserAdvManager'))
     378  {
     379    die('Fatal error on plugin upgrade process : Unable to rename directory ! Please, rename manualy the plugin directory name from ../plugins/NBC_UserAdvManager to ../plugins/UserAdvManager.');
     380  }
    358381}
    359382?>
Note: See TracChangeset for help on using the changeset viewer.