break;
}
- system_message('Database has been installed.');
+ system_message(elgg_echo('install:success:database'));
$this->continueToNextStep('database');
} while (FALSE); // PHP doesn't support breaking out of if statements
break;
}
- system_message('Site settings have been saved.');
+ system_message(elgg_echo('install:success:settings'));
$this->continueToNextStep('settings');
break;
}
- system_message('Admin account has been created.');
+ system_message(elgg_echo('install:success:admin'));
$this->continueToNextStep('admin');
function checkDatabaseSettings($user, $password, $dbname, $host) {
$mysql_dblink = mysql_connect($host, $user, $password, true);
if ($mysql_dblink == FALSE) {
- register_error('Unable to connect to the database with these settings.');
+ register_error(elgg_echo('install:error:databasesettings'));
return $FALSE;
}
$result = mysql_select_db($dbname, $mysql_dblink);
// check MySQL version - must be 5.0 or >
+ $required_version = 5.0;
$version = mysql_get_server_info();
$points = explode('.', $version);
- if ($points[0] < 5) {
- register_error("MySQL must be 5.0 or above. Your server is using $version.");
+ if ($points[0] < $required_version) {
+ register_error(sprintf(elgg_echo('install:error:oldmysql'), $version));
return FALSE;
}
mysql_close($mysql_dblink);
if (!$result) {
- register_error("Unable to use database $dbname");
+ register_error(sprintf(elgg_echo('install:error:nodatabase'), $dbname));
}
return $result;
$templateFile = "{$CONFIG->path}engine/settings.example.php";
$template = file_get_contents($templateFile);
if (!$template) {
- register_error('Unable to read engine/settings.example.php');
+ register_error(elgg_echo('install:error:readsettingsphp'));
return FALSE;
}
$settingsFilename = "{$CONFIG->path}engine/settings.php";
$result = file_put_contents($settingsFilename, $template);
if (!$result) {
- register_error('Unable to write engine/settings.php');
+ register_error(elgg_echo('install:error:writesettingphp'));
return FALSE;
}
global $CONFIG;
if (!include_once("{$CONFIG->path}engine/settings.php")) {
- register_error("Elgg could not load the settings file.");
+ register_error(elgg_echo('InstallationException:CannotLoadSettings'));
return FALSE;
}
if (!include_once("{$CONFIG->path}engine/lib/database.php")) {
- register_error("Elgg could not load the database library.");
+ $msg = sprintf(elgg_echo('InstallationException:MissingLibrary'), 'database.php');
+ register_error($msg);
return FALSE;
}
foreach ($formVars as $field => $info) {
if ($info['required'] == TRUE && !$submissionVars[$field]) {
$name = elgg_echo("install:settings:label:$field");
- register_error("$name is required");
+ register_error(sprintf(elgg_echo('install:error:requiredfield')), $name);
return FALSE;
}
}
// check that data root is writable
if (!is_writable($submissionVars['dataroot'])) {
- register_error("Your data directory {$submissionVars['dataroot']} is not writable by the web server.");
+ $msg = sprintf(elgg_echo('install:error:writedatadirectory'), $submissionVars['dataroot']);
+ register_error($msg);
return FALSE;
}
// check that data root is not subdirectory of Elgg root
if (stripos($submissionVars['dataroot'], $submissionVars['path']) !== FALSE) {
- register_error("Your data directory {$submissionVars['dataroot']} must be outside of your install path for security.");
+ $msg = sprintf(elgg_echo('install:error:locationdatadirectory'), $submissionVars['dataroot']);
+ register_error($msg);
return FALSE;
}
$guid = $site->save();
if (!$guid) {
- register_error("Unable to create the site.");
+ register_error(elgg_echo('install:error:createsite'));
return FALSE;
}
foreach ($formVars as $field => $info) {
if ($info['required'] == TRUE && !$submissionVars[$field]) {
$name = elgg_echo("install:admin:label:$field");
- register_error("$name is required");
+ register_error(sprintf(elgg_echo('install:error:requiredfield'), $name));
return FALSE;
}
}
'install:admin:cannot_create' => 'Unable to create an admin account.',
'install:complete:instructions' => 'Your Elgg site is now ready to be used. Click the button below to be taken to your site.',
-
-
- 'InstallationException:UnknownStep' => '%s is an unknown installation step.',
-
+ 'install:complete:gotosite' => 'Go to site',
+
+ 'InstallationException:UnknownStep' => '%s is an unknown installation step.',
+
+ 'install:success:database' => 'Database has been installed.',
+ 'install:success:settings' => 'Site settings have been saved.',
+ 'install:success:admin' => 'Admin account has been created.',
+
+ 'install:error:databasesettings' => 'Unable to connect to the database with these settings.',
+ 'install:error:oldmysql' => 'MySQL must be version 5.0 or above. Your server is using %s.',
+ 'install:error:nodatabase' => 'Unable to use database %s. It may not exist.',
+ 'install:error:readsettingsphp' => 'Unable to read engine/settings.example.php',
+ 'install:error:writesettingphp' => 'Unable to write engine/settings.php',
+ 'install:error:requiredfield' => '%s is required',
+ 'install:error:writedatadirectory' => 'Your data directory %s is not writable by the web server.',
+ 'install:error:locationdatadirectory' => 'Your data directory %s must be outside of your install path for security.',
+ 'install:error:createsite' => 'Unable to create the site.',
);
add_translation("en", $english);