From: <tr...@us...> - 2003-02-16 02:03:52
|
Update of /cvsroot/basedb/basedb/include/web In directory sc8-pr-cvs1:/tmp/cvs-serv9956/include/web Modified Files: newinit.inc.php Log Message: rewrote BaseControl to be much more robust and optionally use flock() Index: newinit.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/include/web/newinit.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** newinit.inc.php 13 Feb 2003 12:34:39 -0000 1.5 --- newinit.inc.php 16 Feb 2003 02:03:49 -0000 1.6 *************** *** 3,7 **** // // BioArray Software Environment (BASE) - homepage http://base.thep.lu.se/ ! // Copyright (C) 2002 Lao Saal, Carl Troein, Johan Vallon-Christersson // // This file is part of BASE. --- 3,7 ---- // // BioArray Software Environment (BASE) - homepage http://base.thep.lu.se/ ! // Copyright (C) 2002,2003 Lao Saal, Carl Troein, Johan Vallon-Christersson // // This file is part of BASE. *************** *** 22,27 **** // ! if(!isset($config)) ! die("Fatal error: newinit.inc.php included without config.inc.php!\n"); require_once("db.inc.php"); --- 22,27 ---- // ! if(!isset($config)) ! die("Fatal error: newinit.inc.php included without config.inc.php!\n"); require_once("db.inc.php"); *************** *** 44,48 **** $BC = new BaseControl(); ! if(!$BC->mayRun()) { $url = ereg_replace("^$config[urlpath]", --- 44,53 ---- $BC = new BaseControl(); ! $start = $BC->startScript(); ! if($start == -1) ! die("Failed to connect to database. See the error log for details"); ! else if($start < 0) ! die("Script startup failed. See the error log for details"); ! else if(!$start) { $url = ereg_replace("^$config[urlpath]", *************** *** 50,60 **** redirect("downtime.phtml?location=".urlencode($url)); } - - if(!db_connect($config["dbHost"], $config["dbUser"], - $config["dbPassword"], $config["dbDatabase"])) - { - die("Failed to connect to database. See the error log for details"); - } - unset($config["dbPassword"]); // Perfectly normal paranoia Session::purgeSessions($config["sessionTimeout"]); --- 55,58 ---- |