2 /// install.php - helps admin user to create a config.php file
4 /// If config.php exists already then we are not needed.
6 if (file_exists('./config.php')) {
7 header('Location: index.php');
10 $configfile = './config.php';
13 ///==========================================================================//
14 /// We are doing this in stages
15 define ('WELCOME', 0); /// 0. Welcome and language settings
16 define ('COMPATIBILITY', 1); /// 1. Compatibility
17 define ('DIRECTORY', 2); /// 2. Directory settings
18 define ('DATABASE', 3); /// 2. Database settings
19 define ('ADMIN', 4); /// 4. Administration directory name
20 define ('ENVIRONMENT', 5); /// 5. Administration directory name
21 define ('SAVE', 6); /// 6. Save or display the settings
22 define ('REDIRECT', 7); /// 7. Redirect to index.php
23 ///==========================================================================//
27 /// Begin the session as we are holding all information in a session
28 /// variable until the end.
30 session_name('MoodleSession');
33 if (! isset($_SESSION['INSTALL'])) {
34 $_SESSION['INSTALL'] = array();
37 $INSTALL = &$_SESSION['INSTALL']; // Makes it easier to reference
40 /// If it's our first time through this script then we need to set some default values
42 if ( empty($INSTALL['language']) and empty($_POST['language']) ) {
45 $INSTALL['language'] = 'en';
47 $INSTALL['dbhost'] = 'localhost';
48 $INSTALL['dbuser'] = '';
49 $INSTALL['dbpass'] = '';
50 $INSTALL['dbtype'] = 'mysql';
51 $INSTALL['dbname'] = 'moodle';
52 $INSTALL['prefix'] = 'mdl_';
54 $INSTALL['dbencodingtestresults'] = false;
55 $INSTALL['showskipdbencodingtest'] = false;
56 $INSTALL['skipdbencodingtest'] = false;
58 $INSTALL['wwwroot'] = '';
59 $INSTALL['dirroot'] = dirname(__FILE__
);
60 $INSTALL['dataroot'] = dirname(dirname(__FILE__
)) . '/moodledata';
62 $INSTALL['admindirname'] = 'admin';
64 $INSTALL['stage'] = WELCOME
;
67 //==========================================================================//
69 /// Was data submitted?
71 if (isset($_POST['stage'])) {
73 /// Get the stage for which the form was set and the next stage we are going to
76 if ( $goforward = (! empty( $_POST['next'] )) ) {
77 $nextstage = $_POST['stage'] +
1;
79 $nextstage = $_POST['stage'] - 1;
83 if ($nextstage < 0) $nextstage = WELCOME
;
86 /// Store any posted data
87 foreach ($_POST as $setting=>$value) {
88 $INSTALL[$setting] = $value;
98 //==========================================================================//
100 /// Fake some settings so that we can use selected functions from moodlelib.php and weblib.php
102 $SESSION->lang
= (!empty($_POST['language'])) ?
$_POST['language'] : $INSTALL['language'];
103 $CFG->dirroot
= $INSTALL['dirroot'];
104 $CFG->libdir
= $INSTALL['dirroot'].'/lib';
105 $CFG->dataroot
= $INSTALL['dataroot'];
106 $CFG->admin
= $INSTALL['admindirname'];
107 $CFG->directorypermissions
= 00777;
109 /// Include some moodle libraries
111 require_once('./lib/setuplib.php');
112 require_once('./lib/moodlelib.php');
113 require_once('./lib/weblib.php');
114 require_once('./lib/adodb/adodb.inc.php');
115 require_once('./lib/environmentlib.php');
116 require_once('./lib/xmlize.php');
117 require_once('./version.php');
119 /// Set version and release
120 $INSTALL['version'] = $version;
121 $INSTALL['release'] = $release;
123 /// Have the $db object ready because we are going to use it often
124 $db = &ADONewConnection($INSTALL['dbtype']);
126 /// guess the www root
127 if ($INSTALL['wwwroot'] == '') {
128 list($INSTALL['wwwroot'], $xtra) = explode('/install.php', qualified_me());
131 $headstagetext = array(WELCOME
=> get_string('chooselanguagehead', 'install'),
132 COMPATIBILITY
=> get_string('compatibilitysettingshead', 'install'),
133 DIRECTORY
=> get_string('directorysettingshead', 'install'),
134 DATABASE
=> get_string('databasesettingshead', 'install'),
135 ADMIN
=> get_string('admindirsettinghead', 'install'),
136 ENVIRONMENT
=> get_string('environmenthead', 'install'),
137 SAVE
=> get_string('configurationcompletehead', 'install')
140 $substagetext = array(WELCOME
=> get_string('chooselanguagesub', 'install'),
141 COMPATIBILITY
=> get_string('compatibilitysettingssub', 'install'),
142 DIRECTORY
=> get_string('directorysettingssub', 'install'),
143 DATABASE
=> get_string('databasesettingssub', 'install'),
144 ADMIN
=> get_string('admindirsettingsub', 'install'),
145 ENVIRONMENT
=> get_string('environmentsub', 'install'),
146 SAVE
=> get_string('configurationcompletesub', 'install')
151 //==========================================================================//
153 /// Are we in help mode?
155 if (isset($_GET['help'])) {
161 //==========================================================================//
163 /// Are we in config download mode?
165 if (isset($_GET['download'])) {
166 header("Content-Type: application/download\n");
167 header("Content-Disposition: attachment; filename=\"config.php\"");
168 echo $INSTALL['config'];
176 //==========================================================================//
178 /// Check the directory settings
180 if ($INSTALL['stage'] == DIRECTORY
) {
186 if (($fh = @fopen
($INSTALL['dirroot'].'/install.php', 'r')) === false ) {
187 $CFG->dirroot
= dirname(__FILE__
);
188 $INSTALL['dirroot'] = dirname(__FILE__
);
189 $errormsg .= get_string('dirrooterror', 'install').'<br />';
191 if ($fh) fclose($fh);
193 $CFG->dirroot
= $INSTALL['dirroot'];
196 if (ini_get('allow_url_fopen')) {
197 if (($fh = @fopen
($INSTALL['wwwroot'].'/install.php', 'r')) === false) {
198 $errormsg .= get_string('wwwrooterror', 'install').'<br />';
201 if ($fh) fclose($fh);
204 $CFG->dataroot
= $INSTALL['dataroot'];
205 if (make_upload_directory('sessions', false) === false ) {
206 $errormsg = get_string('datarooterror', 'install').'<br />';
208 if ($fh) fclose($fh);
210 if (!empty($errormsg)) $nextstage = DIRECTORY
;
217 //==========================================================================//
219 /// Check database settings if stage 3 data submitted
220 /// Try to connect to the database. If that fails then try to create the database
222 if ($INSTALL['stage'] == DATABASE
) {
224 /// First of all, analyze skipdbencodingtest status
225 if (isset($_POST['skipdbencodingtest'])) {
226 $INSTALL['skipdbencodingtest'] = true;
228 $INSTALL['skipdbencodingtest'] = false;
231 /// different format for postgres7 by socket
232 if ($INSTALL['dbtype'] == 'postgres7' and ($INSTALL['dbhost'] == 'localhost' ||
$INSTALL['dbhost'] == '127.0.0.1')) {
233 $INSTALL['dbhost'] = "user='{$INSTALL['dbuser']}' password='{$INSTALL['dbpass']}' dbname='{$INSTALL['dbname']}'";
234 $INSTALL['dbuser'] = '';
235 $INSTALL['dbpass'] = '';
236 $INSTALL['dbname'] = '';
238 if ($INSTALL['prefix'] == '') { /// must have a prefix
239 $INSTALL['prefix'] = 'mdl_';
243 if ($INSTALL['dbtype'] == 'mysql') { /// Check MySQL extension is present
244 if (!extension_loaded('mysql')) {
245 $errormsg = get_string('mysqlextensionisnotpresentinphp', 'install');
246 $nextstage = DATABASE
;
250 if (empty($errormsg)) {
252 error_reporting(0); // Hide errors
254 if (! $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname'])) {
255 /// The following doesn't seem to work but we're working on it
256 /// If you come up with a solution for creating a database in MySQL
257 /// feel free to put it in and let us know
258 if ($dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'])) {
259 switch ($INSTALL['dbtype']) { /// Try to create a database
261 if ($db->Execute("CREATE DATABASE {$INSTALL['dbname']};")) {
262 $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']);
264 $errormsg = get_string('dbcreationerror', 'install');
265 $nextstage = DATABASE
;
271 /// We have been able to connect properly, just test the database encoding now. It should be Unicode for 1.6
272 /// installations (although not mandatory for now). Just show one message about it and allow to skip this test.
273 if (empty($INSTALL['skipdbencodingtest'])) {
274 /// We haven't checked the skip test checkbox, so perform the test
276 switch ($INSTALL['dbtype']) {
278 ///Get MySQL character_set_database value
279 $rs = $db->Execute("SHOW VARIABLES LIKE 'character_set_database'");
280 if ($rs && $rs->RecordCount() > 0) {
281 $records = $rs->GetAssoc(true);
282 $encoding = $records['character_set_database']['Value'];
283 if (strtoupper($encoding) != 'UTF8') {
284 $errormsg = get_string('dbwrongencoding', 'install', $encoding);
285 $nextstage = DATABASE
;
286 $INSTALL['showskipdbencodingtest'] = true;
287 $INSTALL['dbencodingtestresults'] = false;
289 $INSTALL['dbencodingtestresults'] = true;
294 ///Get PostgreSQL server_encoding value
295 $rs = $db->Execute("SHOW server_encoding");
296 if ($rs && $rs->RecordCount() > 0) {
297 $encoding = $rs->fields
['server_encoding'];
298 if (strtoupper($encoding) != 'UNICODE') {
299 $errormsg = get_string('dbwrongencoding', 'install', $encoding);
300 $nextstage = DATABASE
;
301 $INSTALL['showskipdbencodingtest'] = true;
302 $INSTALL['dbencodingtestresults'] = false;
304 $INSTALL['dbencodingtestresults'] = true;
315 if (($dbconnected === false) and (empty($errormsg)) ) {
316 $errormsg = get_string('dbconnectionerror', 'install');
317 $nextstage = DATABASE
;
323 //==========================================================================//
325 /// If the next stage is admin directory settings OR we have just come from there then
326 /// check the admin directory.
327 /// If we can open a file then we know that the admin name is correct.
329 if ($nextstage == ADMIN
or $INSTALL['stage'] == ADMIN
) {
330 if (!ini_get('allow_url_fopen')) {
331 $nextstage = ($goforward) ? ENVIRONMENT
: DATABASE
;
332 } else if (($fh = @fopen
($INSTALL['wwwroot'].'/'.$INSTALL['admindirname'].'/site.html', 'r')) !== false) {
333 $nextstage = ($goforward) ? ENVIRONMENT
: DATABASE
;
336 if ($nextstage != ADMIN
) {
337 $errormsg = get_string('admindirerror', 'install');
343 //==========================================================================//
345 // Check if we can navigate from the environemt page (because it's ok)
347 if ($INSTALL['stage'] == ENVIRONMENT
) {
348 error_reporting(0); // Hide errors
349 $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']);
350 error_reporting(7); // Show errors
352 /// Execute environment check, printing results
353 if (!check_moodle_environment($INSTALL['release'], $environment_results, false)) {
354 $nextstage = ENVIRONMENT
;
357 /// We never should reach this because DB has been tested before arriving here
358 $errormsg = get_string('dbconnectionerror', 'install');
359 $nextstage = DATABASE
;
364 //==========================================================================//
366 /// Display or print the data
367 /// Put the data into a string
368 /// Try to open config file for writing.
370 if ($nextstage == SAVE
) {
372 $str = '<?php /// Moodle Configuration File '."\r\n";
375 $str .= 'unset($CFG);'."\r\n";
378 $str .= '$CFG->dbtype = \''.$INSTALL['dbtype']."';\r\n";
379 $str .= '$CFG->dbhost = \''.addslashes($INSTALL['dbhost'])."';\r\n";
380 if (!empty($INSTALL['dbname'])) {
381 $str .= '$CFG->dbname = \''.$INSTALL['dbname']."';\r\n";
382 $str .= '$CFG->dbuser = \''.$INSTALL['dbuser']."';\r\n";
383 $str .= '$CFG->dbpass = \''.$INSTALL['dbpass']."';\r\n";
385 $str .= '$CFG->dbpersist = false;'."\r\n";
386 $str .= '$CFG->prefix = \''.$INSTALL['prefix']."';\r\n";
389 $str .= '$CFG->wwwroot = \''.$INSTALL['wwwroot']."';\r\n";
390 $str .= '$CFG->dirroot = \''.$INSTALL['dirroot']."';\r\n";
391 $str .= '$CFG->dataroot = \''.$INSTALL['dataroot']."';\r\n";
392 $str .= '$CFG->admin = \''.$INSTALL['admindirname']."';\r\n";
395 $str .= '$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode'."\r\n";
398 if (!$INSTALL['skipdbencodingtest'] && $INSTALL['dbencodingtestresults']) {
399 $str .= '$CFG->unicodedb = true; // Database is utf8'."\r\n";
403 $str .= 'require_once("$CFG->dirroot/lib/setup.php");'."\r\n";
404 $str .= '// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,'."\r\n";
405 $str .= '// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.'."\r\n";
410 if (( $configsuccess = ($fh = @fopen
($configfile, 'w')) ) !== false) {
416 $INSTALL['config'] = $str;
421 //==========================================================================//
427 <html dir
="<?php echo (get_string('this_direction') == 'rtl') ? 'rtl' : 'ltr' ?>">
429 <link rel
="shortcut icon" href
="theme/standard/favicon.ico" />
430 <title
>Moodle Install
</title
>
431 <meta http
-equiv
="content-type" content
="text/html; charset=<?php p(current_charset()) ?>" />
432 <?php
css_styles() ?
>
440 if (isset($_GET['help'])) {
441 print_install_help($_GET['help']);
442 close_window_button();
447 <table
class="main" align
="center" cellpadding
="3" cellspacing
="0">
449 <td
class="td_mainlogo">
450 <p
class="p_mainlogo"><img src
="pix/moodlelogo-med.gif" width
="240" height
="60" alt
=\"\"></p
>
452 <td
class="td_mainlogo" valign
="bottom">
453 <p
class="p_mainheader"><?php
print_string('installation', 'install') ?
></p
>
458 <td
class="td_mainheading" colspan
="2">
459 <p
class="p_mainheading"><?php
echo $headstagetext[$nextstage] ?
></p
>
460 <?php
if (!empty($substagetext[$nextstage])) { ?
>
461 <p
class="p_subheading"><?php
echo $substagetext[$nextstage] ?
></p
>
467 <td
class="td_main" colspan
="2">
471 if (!empty($errormsg)) echo "<p class=\"errormsg\" align=\"center\">$errormsg</p>\n";
474 if ($nextstage == SAVE
) {
475 $INSTALL['stage'] = WELCOME
;
477 $options['lang'] = $INSTALL['language'];
478 if ($configsuccess) {
479 echo "<p>".get_string('configfilewritten', 'install')."</p>\n";
481 echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n";
483 echo "<td width=\"33.3%\"> </td>\n";
484 echo "<td width=\"33.3%\"> </td>\n";
485 echo "<td width=\"33.3%\" align=\"right\">\n";
486 print_single_button("index.php", $options, get_string('continue')." »");
492 echo "<p class=\"errormsg\">".get_string('configfilenotwritten', 'install')."</p>";
494 echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n";
496 echo "<td width=\"33.3%\"> </td>\n";
497 echo "<td width=\"33.3%\" align=\"center\">\n";
498 $installoptions = array();
499 $installoptions['download'] = 1;
500 print_single_button("install.php", $installoptions, get_string('download', 'install'));
502 echo "<td width=\"33.3%\" align=\"right\">\n";
503 print_single_button("index.php", $options, get_string('continue')." »");
509 echo "<div style=\"text-align: left\">\n";
510 print_object(htmlentities($str));
514 $formaction = (isset($_GET['configfile'])) ?
"install.php?configfile=".$_GET['configfile'] : "install.php";
515 form_table($nextstage, $formaction);
542 //==========================================================================//
545 function print_object($object) {
553 //==========================================================================//
555 function form_table($nextstage = WELCOME
, $formaction = "install.php") {
556 global $INSTALL, $db;
558 /// standard lines for all forms
561 <form name
="installform" method
="post" action
="<?php echo $formaction ?>">
562 <input type
="hidden" name
="stage" value
="<?php echo $nextstage ?>" />
563 <table
class="install_table" cellspacing
="3" cellpadding
="3" align
="center">
566 /// what we do depends on the stage we're at
567 switch ($nextstage) {
568 case WELCOME
: /// Welcome and language settings
571 <td
class="td_left"><p
><?php
print_string('language') ?
></p
></td
>
572 <td
class="td_right">
573 <?php
choose_from_menu (get_list_of_languages(), 'language', $INSTALL['language'], '') ?
>
579 case COMPATIBILITY
: /// Compatibilty check
580 $compatsuccess = true;
582 /// Check that PHP is of a sufficient version
583 print_compatibility_row(check_php_version("4.1.0"), get_string('phpversion', 'install'), get_string('phpversionerror', 'install'), 'phpversionhelp');
584 /// Check session auto start
585 print_compatibility_row(!ini_get_bool('session.auto_start'), get_string('sessionautostart', 'install'), get_string('sessionautostarterror', 'install'), 'sessionautostarthelp');
586 /// Check magic quotes
587 print_compatibility_row(!ini_get_bool('magic_quotes_runtime'), get_string('magicquotesruntime', 'install'), get_string('magicquotesruntimeerror', 'install'), 'magicquotesruntimehelp');
588 /// Check unsupported PHP configuration
589 print_compatibility_row(ini_get_bool('magic_quotes_gpc') ||
(!ini_get_bool('register_globals')), get_string('globalsquotes', 'install'), get_string('globalsquoteserror', 'install'), 'globalsquoteshelp');
591 print_compatibility_row(!ini_get_bool('safe_mode'), get_string('safemode', 'install'), get_string('safemodeerror', 'install'), 'safemodehelp', true);
592 /// Check file uploads
593 print_compatibility_row(ini_get_bool('file_uploads'), get_string('fileuploads', 'install'), get_string('fileuploadserror', 'install'), 'fileuploadshelp', true);
595 print_compatibility_row(check_gd_version(), get_string('gdversion', 'install'), get_string('gdversionerror', 'install'), 'gdversionhelp', true);
596 /// Check memory limit
597 print_compatibility_row(check_memory_limit(), get_string('memorylimit', 'install'), get_string('memorylimiterror', 'install'), 'memorylimithelp', true);
601 case DIRECTORY
: /// Directory settings
605 <td
class="td_left"><p
><?php
print_string('wwwroot', 'install') ?
></p
></td
>
606 <td
class="td_right">
607 <input type
="text" size
="40"name
="wwwroot" value
="<?php echo $INSTALL['wwwroot'] ?>" />
611 <td
class="td_left"><p
><?php
print_string('dirroot', 'install') ?
></p
></td
>
612 <td
class="td_right">
613 <input type
="text" size
="40" name
="dirroot" value
="<?php echo $INSTALL['dirroot'] ?>" />
617 <td
class="td_left"><p
><?php
print_string('dataroot', 'install') ?
></p
></td
>
618 <td
class="td_right">
619 <input type
="text" size
="40" name
="dataroot" value
="<?php echo $INSTALL['dataroot'] ?>" />
625 case DATABASE
: /// Database settings
629 <td
class="td_left"><p
><?php
print_string('dbtype', 'install') ?
></p
></td
>
630 <td
class="td_right">
631 <?php
choose_from_menu (array("mysql" => "mysql", "postgres7" => "postgres7"), 'dbtype', $INSTALL['dbtype'], '') ?
>
635 <td
class="td_left"><p
><?php
print_string('dbhost', 'install') ?
></p
></td
>
636 <td
class="td_right">
637 <input type
="text" size
="40" name
="dbhost" value
="<?php echo $INSTALL['dbhost'] ?>" />
641 <td
class="td_left"><p
><?php
print_string('database', 'install') ?
></p
></td
>
642 <td
class="td_right">
643 <input type
="text" size
="40" name
="dbname" value
="<?php echo $INSTALL['dbname'] ?>" />
647 <td
class="td_left"><p
><?php
print_string('user') ?
></p
></td
>
648 <td
class="td_right">
649 <input type
="text" size
="40" name
="dbuser" value
="<?php echo $INSTALL['dbuser'] ?>" />
653 <td
class="td_left"><p
><?php
print_string('password') ?
></p
></td
>
654 <td
class="td_right">
655 <input type
="password" size
="40" name
="dbpass" value
="<?php echo $INSTALL['dbpass'] ?>" />
659 <td
class="td_left"><p
><?php
print_string('dbprefix', 'install') ?
></p
></td
>
660 <td
class="td_right">
661 <input type
="text" size
="40" name
="prefix" value
="<?php echo $INSTALL['prefix'] ?>" />
664 <?php
if ($INSTALL['showskipdbencodingtest']) { ?
>
666 <td
class="td_left" colspan
="2">
667 <?php
print_checkbox ('skipdbencodingtest', '1', $INSTALL['skipdbencodingtest'], get_string('skipdbencodingtest', 'install')) ?
>
674 case ADMIN
: /// Administration directory setting
678 <td
class="td_left"><p
><?php
print_string('admindirname', 'install') ?
></p
></td
>
679 <td
class="td_right">
680 <input type
="text" size
="40" name
="admindirname" value
="<?php echo $INSTALL['admindirname'] ?>" />
687 case ENVIRONMENT
: /// Environment checks
693 error_reporting(0); // Hide errors
694 $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']);
695 error_reporting(7); // Show errors
697 /// Execute environment check, printing results
698 check_moodle_environment($INSTALL['release'], $environment_results, true);
700 /// We never should reach this because DB has been tested before arriving here
701 $errormsg = get_string('dbconnectionerror', 'install');
702 $nextstage = DATABASE
;
703 echo '<p class="errormsg" align="center">'.get_string('dbconnectionerror', 'install').'</p>';
718 <td colspan
="<?php echo ($nextstage == COMPATIBILITY) ? 3 : 2; ?>">
720 <?php
echo ($nextstage < SAVE
) ?
"<input type=\"submit\" name=\"next\" value=\"".get_string('next')." »\" style=\"float: right\"/>\n" : " \n" ?
>
721 <?php
echo ($nextstage > WELCOME
) ?
"<input type=\"submit\" name=\"prev\" value=\"« ".get_string('previous')."\" style=\"float: left\"/>\n" : " \n" ?
>
736 //==========================================================================//
738 function print_compatibility_row($success, $testtext, $errormessage, $helpfield='', $caution=false) {
740 echo "<td class=\"td_left\" valign=\"top\" nowrap width=\"160\"><p>$testtext</p></td>\n";
742 echo "<td valign=\"top\"><p class=\"p_pass\">".get_string('pass', 'install')."</p></td>\n";
743 echo "<td valign=\"top\"> </td>\n";
745 echo "<td valign=\"top\"";
746 echo ($caution) ?
"<p class=\"p_caution\">".get_string('caution', 'install') : "<p class=\"p_fail\">".get_string('fail', 'install');
748 echo "<td valign=\"top\">";
749 echo "<p>$errormessage ";
750 install_helpbutton("install.php?help=$helpfield");
758 //==========================================================================//
760 function install_helpbutton($url, $title='') {
762 $title = get_string('help');
764 echo "<a href=\"javascript: void(0)\">";
765 echo "<img src=\"./pix/help.gif\" height=\"17\" width=\"17\" alt=\"$title\"";
766 echo "border=\"0\" align=\"middle\" title=\"$title\" ";
767 echo "onClick=\"return window.open('$url', 'Help', 'menubar=0,location=0,scrollbars,resizable,width=500,height=400')\">";
773 //==========================================================================//
775 function print_install_help($help) {
777 case 'phpversionhelp':
778 print_string($help, 'install', phpversion());
780 case 'memorylimithelp':
781 print_string($help, 'install', get_memory_limit());
784 print_string($help, 'install');
789 //==========================================================================//
791 function get_memory_limit() {
792 if ($limit = ini_get('memory_limit')) {
795 return get_cfg_var('memory_limit');
799 //==========================================================================//
801 function check_memory_limit() {
803 /// if limit is already 16M or more then we don't care if we can change it or not
804 if ((int)str_replace('M', '', get_memory_limit()) >= 16) {
808 /// Otherwise, see if we can change it ourselves
809 @ini_set
('memory_limit', '16M');
810 return ((int)str_replace('M', '', get_memory_limit()) >= 16);
813 //==========================================================================//
815 function css_styles() {
818 <style type
="text/css">
820 body
{ background
-color
: #ffeece; }
822 font
-family
: helvetica
, arial
, sans
-serif
;
825 a
{ text
-decoration
: none
; color
: blue
; }
831 font
-family
: courier
, monospace
;
848 border
-color
: #ffc85f;
849 -moz
-border
-radius
-bottomleft
: 15px
;
850 -moz
-border
-radius
-bottomright
: 15px
;
853 background
-color
: #fee6b9;
889 font
-family
: helvetica
, arial
, sans
-serif
;
896 border
-color
: #ffc85f;
899 background
-color
: #fee6b9;
903 background
-color
: #ffeece;