Changeset 11511 for trunk/include


Ignore:
Timestamp:
Jun 26, 2011, 12:03:12 AM (13 years ago)
Author:
plg
Message:

feature 2365 added: Piwigo version is written in the database (as
"piwigo_db_version" in the config table). We only store the branch,
not the release : 2.3 and not 2.3.1, because database structure is
not changing between minor releases.

Location:
trunk/include
Files:
2 edited

Legend:

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

    r10128 r11511  
    133133
    134134load_conf_from_db();
     135
     136if (!$conf['check_upgrade_feed'])
     137{
     138  if (!isset($conf['piwigo_db_version']) or $conf['piwigo_db_version'] != get_branch_from_version(PHPWG_VERSION))
     139  {
     140    redirect(get_root_url().'upgrade.php');
     141  }
     142}
     143
    135144load_plugins();
    136145
  • trunk/include/functions.inc.php

    r11162 r11511  
    16011601  return $options;
    16021602}
     1603
     1604
     1605/**
     1606 * return the branch from the version. For example version 2.2.4 is for branch 2.2
     1607 */
     1608function get_branch_from_version($version)
     1609{
     1610  return implode('.', array_slice(explode('.', $version), 0, 2));
     1611}
    16031612?>
Note: See TracChangeset for help on using the changeset viewer.