feature #443134 - unlimited set_time_limit()

This commit is contained in:
Loïc Chapeaux
2001-11-09 22:35:46 +00:00
parent 9ef0dcc928
commit aa245fe53a
7 changed files with 25 additions and 9 deletions

View File

@@ -21,6 +21,9 @@ $Source$
tbl_properties.php3; libraries/indexes.js; lang/*: commited patch
#458014 - Advanced index generation/editing thanks to
Michal Cihar <nijel at users.sourceforge.net>.
* config.inc.php3; Documentation.html; read_dump.php3; tbl_dump.php3;
libraries/common.lib.php3; libraries/build_dump.lib.php3: feature
#443134 - unlimited set_time_limit().
2001-11-08 Robin Johnson <robbat2@users.sourceforge.net>
* config.inc.php3; main.php3; phpinfo.php3: fixed bug #479303

View File

@@ -524,6 +524,15 @@
<br /><br />
</dd>
<dt><b>$cfgExecTimeLimit </b>integer [number of seconds]</dt>
<dd>
Set the number of seconds a script is allowed to run. If seconds is set
to zero, no time limit is imposed.<br />
This setting is used while importing/exporting dump files but has no
effect when PHP is running in safe mode.
<br /><br />
</dd>
<dt><b>$cfgSkipLockedTables </b>boolean</dt>
<dd>
Mark used tables and make it possible to show databases with locked

View File

@@ -96,6 +96,7 @@ unset($cfgServers[0]);
*/
$cfgOBGzip = TRUE; // use GZIP output buffering if possible
$cfgPersistentConnections = FALSE; // use persistent connections to MySQL database
$cfgExecTimeLimit = 300; // maximum execution time in seconds (0 for no limit)
$cfgSkipLockedTables = FALSE; // mark used tables, make possible to show
// locked tables (since MySQL 3.23.30)
$cfgShowSQL = TRUE; // show SQL queries as run

View File

@@ -203,7 +203,7 @@ if (!defined('__LIB_BUILD_DUMP__')){
$replace = array('\0', '\n', '\r', '\Z');
$isFirstRow = TRUE;
@set_time_limit(1200); // 20 Minutes
@set_time_limit($GLOBALS['cfgExecTimeLimit']);
while ($row = mysql_fetch_row($result)) {
for ($j = 0; $j < $fields_cnt; $j++) {
@@ -288,14 +288,13 @@ if (!defined('__LIB_BUILD_DUMP__')){
$isFirstRow = TRUE;
$fields_cnt = mysql_num_fields($result);
while ($row = mysql_fetch_row($result)) {
@set_time_limit(60); // HaRa
$table_list = '(';
@set_time_limit($GLOBALS['cfgExecTimeLimit']); // HaRa
while ($row = mysql_fetch_row($result)) {
$table_list = '(';
for ($j = 0; $j < $fields_cnt; $j++) {
$table_list .= backquote(mysql_field_name($result, $j), $use_backquotes) . ', ';
}
$table_list = substr($table_list, 0, -2);
$table_list .= ')';
@@ -478,10 +477,11 @@ if (!defined('__LIB_BUILD_DUMP__')){
$result = mysql_query($local_query) or mysql_die('', $local_query, '', $error_url);
$fields_cnt = mysql_num_fields($result);
@set_time_limit($GLOBALS['cfgExecTimeLimit']);
// Format the data
$i = 0;
$i = 0;
while ($row = mysql_fetch_row($result)) {
@set_time_limit(60);
$schema_insert = '';
for ($j = 0; $j < $fields_cnt; $j++) {
if (!isset($row[$j])) {

View File

@@ -103,6 +103,9 @@ if (!defined('__LIB_COMMON__')){
include('./config.inc.php3');
// For compatibility with old config.inc.php3
if (!isset($cfgExecTimeLimit)) {
$cfgExecTimeLimit = 300; // 5 minuts
}
if (!isset($cfgShowStats)) {
$cfgShowStats = TRUE;
}

View File

@@ -132,7 +132,7 @@ function split_sql_file(&$ret, $sql, $release)
/**
* Increases the max. allowed time to run a script
*/
@set_time_limit(10000);
@set_time_limit($cfgExecTimeLimit);
/**

View File

@@ -79,7 +79,7 @@ $err_url = 'tbl_properties.php3'
/**
* Increase time limit for script execution and initializes some variables
*/
@set_time_limit(600);
@set_time_limit($cfgExecTimeLimit);
$dump_buffer = '';
// Defines the default <CR><LF> format
$crlf = which_crlf();