Skip to content

Commit 39fda04

Browse files
committed
MDL-73700 core: remove unused functions and strings from installer
While searching for no longer needed PHP 5.x & 7.0 checks, the `phpversionhelp` lang string and, subsequently, the `memorylimithelp` lang string and the `install_helpbutton()` and `install_print_help_page()` functions were discovered. According to comments on MDL-2787 and MDL-64482 they are no longer in use since Moodle 1.x (approximately), neither reachable since some good versions ago. With MDL-17458 (commit 3b09331), the function `print_compatibility_row()` was gone, and it seems like it was the only place calling `install_helpbutton()`. And `install_helpbutton()` was the only place where a link to the help mode (e.g. `install.php?help=$helpfield`) ever surfaced. As both lang strings and functions are particular to the installer and never could have been used outside of it, we are going for direct deletion instead of regular deprecation. Signed-off-by: Daniel Ziegenberg <[email protected]>
1 parent 85304ca commit 39fda04

File tree

4 files changed

+0
-87
lines changed

4 files changed

+0
-87
lines changed

install.php

-5
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@
240240
$hint_admindir = '';
241241
$hint_database = '';
242242

243-
// Are we in help mode?
244-
if (isset($_GET['help'])) {
245-
install_print_help_page($_GET['help']);
246-
}
247-
248243
//first time here? find out suitable dataroot
249244
if (is_null($CFG->dataroot)) {
250245
$CFG->dataroot = __DIR__.'/../moodledata';

install/stringnames.txt

-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ installation,install
4242
invalidmd5,error
4343
langdownloaderror,install
4444
language,moodle
45-
memorylimithelp,install
4645
missingrequiredfield,error
4746
moodlelogo,moodle
4847
next,moodle
@@ -59,7 +58,6 @@ pathssubwwwroot,install
5958
pathsunsecuredataroot,install
6059
pathswrongadmindir,install
6160
phpextension,install
62-
phpversionhelp,install
6361
phpversion,install
6462
previous,moodle
6563
reload,moodle

lang/en/install.php

-22
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,6 @@
150150
$string['langdownloadok'] = 'The language "{$a}" was installed successfully. The installation process will continue in this language.';
151151
$string['memorylimit'] = 'Memory limit';
152152
$string['memorylimiterror'] = 'The PHP memory limit is set quite low ... you may run into problems later.';
153-
$string['memorylimithelp'] = '<p>The PHP memory limit for your server is currently set to {$a}.</p>
154-
155-
<p>This may cause Moodle to have memory problems later on, especially
156-
if you have a lot of modules enabled and/or a lot of users.</p>
157-
158-
<p>We recommend that you configure PHP with a higher limit if possible, like 40M.
159-
There are several ways of doing this that you can try:</p>
160-
<ol>
161-
<li>If you are able to, recompile PHP with <i>--enable-memory-limit</i>.
162-
This will allow Moodle to set the memory limit itself.</li>
163-
<li>If you have access to your php.ini file, you can change the <b>memory_limit</b>
164-
setting in there to something like 40M. If you don\'t have access you might
165-
be able to ask your administrator to do this for you.</li>
166-
<li>On some PHP servers you can create a .htaccess file in the Moodle directory
167-
containing this line:
168-
<blockquote><div>php_value memory_limit 40M</div></blockquote>
169-
<p>However, on some servers this will prevent <b>all</b> PHP pages from working
170-
(you will see errors when you look at pages) so you\'ll have to remove the .htaccess file.</p></li>
171-
</ol>';
172153
$string['mysqliextensionisnotpresentinphp'] = 'PHP has not been properly configured with the MySQLi extension for it to communicate with MySQL. Please check your php.ini file or recompile PHP.';
173154
$string['nativeauroramysql'] = 'Aurora MySQL (native/auroramysql)';
174155
$string['nativeauroramysqlhelp'] = '<p>The database is where most of the Moodle settings and data are stored and must be configured here.</p>
@@ -218,9 +199,6 @@
218199
$string['pgsqlextensionisnotpresentinphp'] = 'PHP has not been properly configured with the PGSQL extension so that it can communicate with PostgreSQL. Please check your php.ini file or recompile PHP.';
219200
$string['phpextension'] = '{$a} PHP extension';
220201
$string['phpversion'] = 'PHP version';
221-
$string['phpversionhelp'] = '<p>Moodle requires a PHP version of at least 5.6.5 or 7.1 (7.0.x has some engine limitations).</p>
222-
<p>You are currently running version {$a}.</p>
223-
<p>You must upgrade PHP or move to a host with a newer version of PHP.</p>';
224202
$string['releasenoteslink'] = 'For information about this version of Moodle, please see the release notes at {$a}';
225203
$string['safemode'] = 'Safe mode';
226204
$string['safemodeerror'] = 'Moodle may have trouble with safe mode on';

lib/installlib.php

-58
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,6 @@ function install_init_dataroot($dataroot, $dirpermissions) {
149149
return true;
150150
}
151151

152-
/**
153-
* Print help button
154-
* @param string $url
155-
* @param string $titel
156-
* @return void
157-
*/
158-
function install_helpbutton($url, $title='') {
159-
if ($title == '') {
160-
$title = get_string('help');
161-
}
162-
echo "<a href=\"javascript:void(0)\" ";
163-
echo "onclick=\"return window.open('$url','Help','menubar=0,location=0,scrollbars,resizable,width=500,height=400')\"";
164-
echo ">";
165-
echo "<img src=\"pix/help.gif\" alt=\"$title\" title=\"$title\"/>";
166-
echo "</a>\n";
167-
}
168-
169152
/**
170153
* This is in function because we want the /install.php to parse in PHP4
171154
*
@@ -275,47 +258,6 @@ function install_generate_configphp($database, $cfg) {
275258
return $configphp;
276259
}
277260

278-
/**
279-
* Prints complete help page used during installation.
280-
* Does not return.
281-
*
282-
* @global object
283-
* @param string $help
284-
*/
285-
function install_print_help_page($help) {
286-
global $CFG, $OUTPUT; //TODO: MUST NOT USE $OUTPUT HERE!!!
287-
288-
@header('Content-Type: text/html; charset=UTF-8');
289-
@header('X-UA-Compatible: IE=edge');
290-
@header('Cache-Control: no-store, no-cache, must-revalidate');
291-
@header('Cache-Control: post-check=0, pre-check=0', false);
292-
@header('Pragma: no-cache');
293-
@header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');
294-
@header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
295-
296-
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
297-
echo '<html dir="'.(right_to_left() ? 'rtl' : 'ltr').'">
298-
<head>
299-
<link rel="shortcut icon" href="theme/clean/pix/favicon.ico" />
300-
<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.'/install/css.php" />
301-
<title>'.get_string('installation','install').'</title>
302-
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
303-
</head><body>';
304-
switch ($help) {
305-
case 'phpversionhelp':
306-
print_string($help, 'install', phpversion());
307-
break;
308-
case 'memorylimithelp':
309-
print_string($help, 'install', @ini_get('memory_limit'));
310-
break;
311-
default:
312-
print_string($help, 'install');
313-
}
314-
echo $OUTPUT->close_window_button(); //TODO: MUST NOT USE $OUTPUT HERE!!!
315-
echo '</body></html>';
316-
die;
317-
}
318-
319261
/**
320262
* Prints installation page header, we can not use weblib yet in installer.
321263
*

0 commit comments

Comments
 (0)