ÿØÿà JFIF ÿÛ „ ( %"1!%)+...383,7(-.+
-+++--++++---+-+-----+---------------+---+-++7-----ÿÀ ß â" ÿÄ ÿÄ H !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ ÿÄ % !1AQa"23‘ÿÚ ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6
öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ
"Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷ó²·˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%Ìòh´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ÇýÊTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆÑªQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»&
î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$ËÚsäÿ
÷Û #°xŸëí(l
»ý3—¥5m!
rt`†0~'j2(]S¦¦kv,ÚÇl¦øJA£Šƒ
J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉä¢mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg
A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD
é©¤&‡ïDbàÁôMÁ..
/**
* Functions to support installation process
*
* @package core
* @subpackage install
* @copyright 2009 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/** INSTALL_WELCOME = 0 */
define('INSTALL_WELCOME', 0);
/** INSTALL_ENVIRONMENT = 1 */
define('INSTALL_ENVIRONMENT', 1);
/** INSTALL_PATHS = 2 */
define('INSTALL_PATHS', 2);
/** INSTALL_DOWNLOADLANG = 3 */
define('INSTALL_DOWNLOADLANG', 3);
/** INSTALL_DATABASETYPE = 4 */
define('INSTALL_DATABASETYPE', 4);
/** INSTALL_DATABASE = 5 */
define('INSTALL_DATABASE', 5);
/** INSTALL_SAVE = 6 */
define('INSTALL_SAVE', 6);
/**
* Tries to detect the right www root setting.
* @return string detected www root
*/
function install_guess_wwwroot() {
$wwwroot = '';
if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
$wwwroot .= 'http://';
} else {
$wwwroot .= 'https://';
}
$hostport = explode(':', $_SERVER['HTTP_HOST']);
$wwwroot .= reset($hostport);
if ($_SERVER['SERVER_PORT'] != 80 and $_SERVER['SERVER_PORT'] != '443') {
$wwwroot .= ':'.$_SERVER['SERVER_PORT'];
}
$wwwroot .= $_SERVER['SCRIPT_NAME'];
list($wwwroot, $xtra) = explode('/install.php', $wwwroot);
return $wwwroot;
}
/**
* Copy of @see{ini_get_bool()}
* @param string $ini_get_arg
* @return bool
*/
function install_ini_get_bool($ini_get_arg) {
$temp = ini_get($ini_get_arg);
if ($temp == '1' or strtolower($temp) == 'on') {
return true;
}
return false;
}
/**
* Creates dataroot if not exists yet,
* makes sure it is writable, add lang directory
* and add .htaccess just in case it works.
*
* @param string $dataroot full path to dataroot
* @param int $dirpermissions
* @return bool success
*/
function install_init_dataroot($dataroot, $dirpermissions) {
if (file_exists($dataroot) and !is_dir($dataroot)) {
// file with the same name exists
return false;
}
umask(0000); // $CFG->umaskpermissions is not set yet.
if (!file_exists($dataroot)) {
if (!mkdir($dataroot, $dirpermissions, true)) {
// most probably this does not work, but anyway
return false;
}
}
@chmod($dataroot, $dirpermissions);
if (!is_writable($dataroot)) {
return false; // we can not continue
}
// create the directory for $CFG->tempdir
if (!is_dir("$dataroot/temp")) {
if (!mkdir("$dataroot/temp", $dirpermissions, true)) {
return false;
}
}
if (!is_writable("$dataroot/temp")) {
return false; // we can not continue
}
// create the directory for $CFG->cachedir
if (!is_dir("$dataroot/cache")) {
if (!mkdir("$dataroot/cache", $dirpermissions, true)) {
return false;
}
}
if (!is_writable("$dataroot/cache")) {
return false; // we can not continue
}
// create the directory for $CFG->langotherroot
if (!is_dir("$dataroot/lang")) {
if (!mkdir("$dataroot/lang", $dirpermissions, true)) {
return false;
}
}
if (!is_writable("$dataroot/lang")) {
return false; // we can not continue
}
// finally just in case some broken .htaccess that prevents access just in case it is allowed
if (!file_exists("$dataroot/.htaccess")) {
if ($handle = fopen("$dataroot/.htaccess", 'w')) {
fwrite($handle, "deny from all\r\nAllowOverride None\r\nNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!\r\n");
fclose($handle);
} else {
return false;
}
}
return true;
}
/**
* Print help button
* @param string $url
* @param string $titel
* @return void
*/
function install_helpbutton($url, $title='') {
if ($title == '') {
$title = get_string('help');
}
echo "";
echo "";
echo "\n";
}
/**
* This is in function because we want the /install.php to parse in PHP4
*
* @param object $database
* @param string $dbhsot
* @param string $dbuser
* @param string $dbpass
* @param string $dbname
* @param string $prefix
* @param mixed $dboptions
* @return string
*/
function install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) {
if (!preg_match('/^[a-z_]*$/', $prefix)) {
return get_string('invaliddbprefix', 'install');
}
try {
try {
$database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);
} catch (moodle_exception $e) {
// let's try to create new database
if ($database->create_database($dbhost, $dbuser, $dbpass, $dbname, $dboptions)) {
$database->connect($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions);
} else {
throw $e;
}
}
return '';
} catch (dml_exception $ex) {
$stringmanager = get_string_manager();
$errorstring = $ex->errorcode.'oninstall';
$legacystring = $ex->errorcode;
if ($stringmanager->string_exists($errorstring, $ex->module)) {
// By using a different string id from the error code we are separating exception handling and output.
$returnstring = $stringmanager->get_string($errorstring, $ex->module, $ex->a);
if ($ex->debuginfo) {
$returnstring .= '
'.$ex->debuginfo;
}
return $returnstring;
} else if ($stringmanager->string_exists($legacystring, $ex->module)) {
// There are some DML exceptions that may be thrown here as well as during normal operation.
// If we have a translated message already we still want to serve it here.
// However it is not the preferred way.
$returnstring = $stringmanager->get_string($legacystring, $ex->module, $ex->a);
if ($ex->debuginfo) {
$returnstring .= '
'.$ex->debuginfo;
}
return $returnstring;
}
// No specific translation. Deliver a generic error message.
return $stringmanager->get_string('dmlexceptiononinstall', 'error', $ex);
}
}
/**
* Returns content of config.php file.
*
* Uses PHP_EOL for generating proper end of lines for the given platform.
*
* @param moodle_database $database database instance
* @param object $cfg copy of $CFG
* @return string
*/
function install_generate_configphp($database, $cfg) {
$configphp = 'export_dbconfig();
foreach ($dbconfig as $key=>$value) {
$key = str_pad($key, 9);
$configphp .= '$CFG->'.$key.' = '.var_export($value, true) . ';' . PHP_EOL;
}
$configphp .= PHP_EOL;
$configphp .= '$CFG->wwwroot = '.var_export($cfg->wwwroot, true) . ';' . PHP_EOL ;
$configphp .= '$CFG->dataroot = '.var_export($cfg->dataroot, true) . ';' . PHP_EOL;
$configphp .= '$CFG->admin = '.var_export($cfg->admin, true) . ';' . PHP_EOL . PHP_EOL;
if (empty($cfg->directorypermissions)) {
$chmod = '02777';
} else {
$chmod = '0' . decoct($cfg->directorypermissions);
}
$configphp .= '$CFG->directorypermissions = ' . $chmod . ';' . PHP_EOL . PHP_EOL;
if (isset($cfg->upgradekey) and $cfg->upgradekey !== '') {
$configphp .= '$CFG->upgradekey = ' . var_export($cfg->upgradekey, true) . ';' . PHP_EOL . PHP_EOL;
}
if (isset($cfg->setsitepresetduringinstall) and $cfg->setsitepresetduringinstall !== '') {
$configphp .= '$CFG->setsitepresetduringinstall = ' . var_export($cfg->setsitepresetduringinstall, true) .
';' . PHP_EOL . PHP_EOL;
}
$configphp .= 'require_once(__DIR__ . \'/lib/setup.php\');' . PHP_EOL . PHP_EOL;
$configphp .= '// There is no php closing tag in this file,' . PHP_EOL;
$configphp .= '// it is intentional because it prevents trailing whitespace problems!' . PHP_EOL;
return $configphp;
}
/**
* Prints complete help page used during installation.
* Does not return.
*
* @global object
* @param string $help
*/
function install_print_help_page($help) {
global $CFG, $OUTPUT; //TODO: MUST NOT USE $OUTPUT HERE!!!
@header('Content-Type: text/html; charset=UTF-8');
@header('X-UA-Compatible: IE=edge');
@header('Cache-Control: no-store, no-cache, must-revalidate');
@header('Cache-Control: post-check=0, pre-check=0', false);
@header('Pragma: no-cache');
@header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');
@header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
echo '';
echo '