Configurable memory limit (RFE #1373904).

This commit is contained in:
Michal Čihař
2005-12-16 13:57:32 +00:00
parent fc270335cf
commit 8c6b3995d1
5 changed files with 34 additions and 15 deletions

View File

@@ -9,6 +9,8 @@ $Source$
* Documentation.html, libraries/common.lib.php,
libraries/config.default.php, libraries/database_interface.lib.php: Add
support for hiding databases (RFE #1372865).
* Documentation.html, export.php, import.php,
libraries/config.default.php: Configurable memory limit (RFE #1373904).
2005-12-14 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/Config.class.php:

View File

@@ -66,7 +66,7 @@
<li>
<b>PHP</b>
<ul>
<li>You need PHP 4.1.0 or newer, with <tt>session</tt> support (<a href="#faq1_31">*</a>)</li>
<li>You need PHP 4.1.0 or newer, with <tt>session</tt> support (<a href="#faq1_31">*</a>)</li>
<li>If you want to display inline thumbnails of JPEGs with the
original aspect ratio, you also need GD2 support in PHP</li>
<li>Starting with phpMyAdmin 2.6.1, MIME-based transformations
@@ -343,7 +343,7 @@ GRANT SELECT (
GRANT SELECT, INSERT, UPDATE, DELETE ON &lt;pma_db&gt;.* TO 'pma'@'localhost';
</pre>
(this of course requires that your <a href="#linked-tables">linked-tables infrastructure</a> be set up).
(this of course requires that your <a href="#linked-tables">linked-tables infrastructure</a> be set up).
<br />
Of course, the above queries only work if your MySQL version supports
the GRANT command. This is the case since 3.22.11.
@@ -864,8 +864,8 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON &lt;pma_db&gt;.* TO 'pma'@'localhost';
you want to have on hold. On every login, this list gets cut to the maximum amount.
<br /><br />
The query history is only available if JavaScript is enabled in your
browser.
The query history is only available if JavaScript is enabled in your
browser.
<br /><br />
To allow the usage of this functionality:
@@ -1003,6 +1003,15 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON &lt;pma_db&gt;.* TO 'pma'@'localhost';
effect when PHP is running in safe mode.
</dd>
<dt><b><a name="cfg_MemoryLimit"></a>$cfg[MemoryLimit] </b>integer [number of bytes]</dt>
<dd>
Set the number of bytes a script is allowed to allocate. If number set
to zero, no 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 />
You can also use any string as in php.ini, eg. '16M'.
</dd>
<dt><b><a name="cfg_SkipLockedTables"></a>$cfg[SkipLockedTables] </b>boolean</dt>
<dd>
Mark used tables and make it possible to show databases with locked
@@ -1705,14 +1714,14 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON &lt;pma_db&gt;.* TO 'pma'@'localhost';
changes to display a query box.
<br /><br />
The size of this query window can be customized with
<tt>$cfg['QueryWindowWidth']</tt> and <tt>$cfg['QueryWindowWidth']</tt>
- both integers for the size in pixels. Note that normally, those
parameters will be modified in <tt>layout.inc.php</tt> for the
theme you are using.
<tt>$cfg['QueryWindowWidth']</tt> and <tt>$cfg['QueryWindowWidth']</tt>
- both integers for the size in pixels. Note that normally, those
parameters will be modified in <tt>layout.inc.php</tt> for the
theme you are using.
<br /><br />
If <tt>$cfg['EditInWindow']</tt> is set to true, a click on [Edit]
from the results page (in the &quot;Showing Rows&quot; section)
opens the query window and puts the current query
If <tt>$cfg['EditInWindow']</tt> is set to true, a click on [Edit]
from the results page (in the &quot;Showing Rows&quot; section)
opens the query window and puts the current query
inside it. If set to false, clicking on the link puts the SQL
query in the right panel's query box.
<br /><br />
@@ -2976,11 +2985,11 @@ RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R]
set to the default (200) or another low value, you could get this
error if your table has a high number of columns. Adjust this setting
accordingly. (Thanks to Klaus Dorninger for the hint).
</li>
<li>
In the <tt>php.ini</tt> directive <tt>arg_separator.input</tt>, a value
</li>
<li>
In the <tt>php.ini</tt> directive <tt>arg_separator.input</tt>, a value
of &quot;;&quot; will cause this error. Replace it with &quot;&amp;;&quot;.
</li>
</li>
</ul>
<a name="faqlimitations"></a><br />

View File

@@ -35,6 +35,9 @@ if ($export_type == 'server') {
* Increase time limit for script execution and initializes some variables
*/
@set_time_limit($cfg['ExecTimeLimit']);
if (!empty($cfg['MemoryLimit'])) {
@ini_set('memory_limit', $cfg['MemoryLimit']);
}
// Start with empty buffer
$dump_buffer = '';

View File

@@ -91,6 +91,10 @@ if (isset($db)) {
}
@set_time_limit($cfg['ExecTimeLimit']);
if (!empty($cfg['MemoryLimit'])) {
@ini_set('memory_limit', $cfg['MemoryLimit']);
}
$timestamp = time();
if (isset($allow_interrupt)) {
$maximum_time = ini_get('max_execution_time');

View File

@@ -126,6 +126,7 @@ $cfg['OBGzip'] = 'auto'; // use GZIP output buffering if possib
$cfg['PersistentConnections'] = FALSE; // use persistent connections to MySQL database
$cfg['ForceSSL'] = FALSE; // whether to force using https
$cfg['ExecTimeLimit'] = 300; // maximum execution time in seconds (0 for no limit)
$cfg['MemoryLimit'] = 0; // maximum alocated bytes (0 for no limit)
$cfg['SkipLockedTables'] = FALSE; // mark used tables, make possible to show
// locked tables (since MySQL 3.23.30)
$cfg['ShowSQL'] = TRUE; // show SQL queries as run