Changeset 1221


Ignore:
Timestamp:
Apr 20, 2006, 9:31:12 PM (18 years ago)
Author:
plg
Message:

partial merge -r1173:1174 from branch-1_6 to trunk: new configuration
parameter die_on_sql_error (upgrade.php and install/upgrade_*.php not
concerned on BSF)

partial merge -r1208:1209 from branch-1_6 to trunk (only bug fix on
incorrect insertion of complex upgrade identifiers)

deletions: upgrade.php and all install/upgrade_*.php because these script
are never up to date on BSF. Anyway, they are only required on a stable
branch.

Location:
trunk
Files:
4 deleted
3 edited

Legend:

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

    r1156 r1221  
    334334$conf['debug_l10n'] = false;
    335335
     336// die_on_sql_error: if an SQL query fails, should everything stop?
     337$conf['die_on_sql_error'] = true;
     338
    336339// +-----------------------------------------------------------------------+
    337340// |                            authentication                             |
  • trunk/include/functions.inc.php

    r1177 r1221  
    652652function my_error($header)
    653653{
     654  global $conf;
     655 
    654656  $error = '<pre>';
    655657  $error.= $header;
     
    657659  $error.= mysql_error();
    658660  $error.= '</pre>';
    659   die ($error);
     661
     662  if ($conf['die_on_sql_error'])
     663  {
     664    die($error);
     665  }
     666  else
     667  {
     668    echo $error;
     669  }
    660670}
    661671
  • trunk/install.php

    r1147 r1221  
    167167include(PHPWG_ROOT_PATH . 'include/constants.php');
    168168include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
     169include(PHPWG_ROOT_PATH . 'admin/include/functions.php');
    169170include(PHPWG_ROOT_PATH . 'include/template.php');
    170171
     
    333334    // make PWG avoid upgrading, we must tell it upgrades have already been
    334335    // made.
     336    list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
     337    define('CURRENT_DATE', $dbnow);
     338    $datas = array();
    335339    foreach (get_available_upgrade_ids() as $upgrade_id)
    336340    {
    337       $query = '
    338 INSERT INTO '.UPGRADE_TABLE.'
    339   (id, applied, description)
    340   VALUES
    341   ('.$upgrade_id.', NOW(), \'upgrade included in installation\')
    342 ';
    343       mysql_query($query);
    344     }
     341      array_push(
     342        $datas,
     343        array(
     344          'id'          => $upgrade_id,
     345          'applied'     => CURRENT_DATE,
     346          'description' => 'upgrade included in installation',
     347          )
     348        );
     349    }
     350    mass_inserts(
     351      UPGRADE_TABLE,
     352      array_keys($datas[0]),
     353      $datas
     354      );
    345355  }
    346356}
Note: See TracChangeset for help on using the changeset viewer.