Ignore:
Timestamp:
Feb 6, 2006, 10:52:16 PM (18 years ago)
Author:
plg
Message:

improvement: upgrades id retrieving in include/common.inc.php and
upgrade_feed.php are now made by dedicated function
get_available_upgrade_ids.

bug fixed: after an installation, you had to play all available upgrades,
which was wrong. install.php inserts informations related to all available
upgrades at installation time. Thus avoiding automatic upgrades.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r1021 r1027  
    489489function redirect( $url )
    490490{
    491   global $user, $template, $lang_info, $conf, $lang, $t2, $page;
     491  global $user, $template, $lang_info, $conf, $lang, $t2, $page, $debug;
    492492
    493493  // $refresh, $url_link and $title are required for creating an automated
     
    973973  return $email;
    974974}
     975
     976/**
     977 * which upgrades are available ?
     978 *
     979 * @return array
     980 */
     981function get_available_upgrade_ids()
     982{
     983  $upgrades_path = PHPWG_ROOT_PATH.'install/db';
     984
     985  $available_upgrade_ids = array();
     986 
     987  if ($contents = opendir($upgrades_path))
     988  {
     989    while (($node = readdir($contents)) !== false)
     990    {
     991      if (is_file($upgrades_path.'/'.$node)
     992          and preg_match('/^(.*?)-database\.php$/', $node, $match))
     993      {
     994        array_push($available_upgrade_ids, $match[1]);
     995      }
     996    }
     997  }
     998  natcasesort($available_upgrade_ids);
     999
     1000  return $available_upgrade_ids;
     1001}
    9751002?>
Note: See TracChangeset for help on using the changeset viewer.