drupal_set_message(st('All necessary changes to %file have been made, so you should now remove write permissions to this file. Failure to remove write permissions to this file is a security risk.',array('%file'=>$settings_file)),'error');
}
// Show end page.
install_complete($profile);
}
/**
*VerifyifDrupalisinstalled.
*/
functioninstall_verify_drupal(){
$result=@db_query("SELECT name FROM {system} WHERE name = 'system'");
drupal_set_message(st('The Drupal installer requires write permissions to %file during the installation process.',array('%file'=>$settings_file)),'error');
'#value'=>'Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that <a href="http://drupal.org/node/270#database">Drupal supports</a>.',
);
}
else{
$form['basic_options']=array(
'#type'=>'fieldset',
'#title'=>'Basic options',
'#description'=>st('<p>To set up your %drupal database, enter the following information.</p>',array('%drupal'=>drupal_install_profile_name())),
);
if(count($db_types)>1){
// Database type
$form['basic_options']['db_type']=array(
'#type'=>'radios',
'#title'=>'Database type',
'#required'=>TRUE,
'#options'=>drupal_detect_database_types(),
'#default_value'=>$db_type,
'#description'=>st('The type of database your %drupal data will be stored in.',array('%drupal'=>drupal_install_profile_name())),
);
$db_path_description=st('The name of the database your %drupal data will be stored in. It must exist on your server before %drupal can be installed.',array('%drupal'=>drupal_install_profile_name()));
}
else{
if(count($db_types)==1){
$db_types=array_values($db_types);
$form['basic_options']['db_type']=array(
'#type'=>'hidden',
'#value'=>$db_types[0],
);
$db_path_description=st('The name of the %db_type database your %drupal data will be stored in. It must exist on your server before %drupal can be installed.',array('%db_type'=>$db_types[0],'%drupal'=>drupal_install_profile_name()));
}
}
// Database name
$form['basic_options']['db_path']=array(
'#type'=>'textfield',
'#title'=>'Database name',
'#default_value'=>$db_path,
'#size'=>45,
'#maxlength'=>45,
'#required'=>TRUE,
'#description'=>$db_path_description
);
// Database username
$form['basic_options']['db_user']=array(
'#type'=>'textfield',
'#title'=>'Database username',
'#default_value'=>$db_user,
'#size'=>45,
'#maxlength'=>45,
'#required'=>TRUE,
);
// Database username
$form['basic_options']['db_pass']=array(
'#type'=>'password',
'#title'=>'Database password',
'#default_value'=>$db_pass,
'#size'=>45,
'#maxlength'=>45,
'#required'=>TRUE,
);
$form['advanced_options']=array(
'#type'=>'fieldset',
'#title'=>'Advanced options',
'#collapsible'=>TRUE,
'#collapsed'=>TRUE,
'#description'=>st('These options are only necessary for some sites. If you\'re not sure what you should enter here, leave the default settings or check with your hosting provider.')
);
// Database host
$form['advanced_options']['db_host']=array(
'#type'=>'textfield',
'#title'=>'Database host',
'#default_value'=>$db_host,
'#size'=>45,
'#maxlength'=>45,
'#required'=>TRUE,
'#description'=>st('If your database is located on a different server, change this.',array('%drupal'=>drupal_install_profile_name())),
);
// Database prefix
$form['advanced_options']['db_prefix']=array(
'#type'=>'textfield',
'#title'=>'Database prefix',
'#default_value'=>$db_prefix,
'#size'=>45,
'#maxlength'=>45,
'#required'=>FALSE,
'#description'=>st('If more than one %drupal web site will be sharing this database, enter a table prefix for your %drupal site here.',array('%drupal'=>drupal_install_profile_name())),
form_set_error('db_user',st('You have configured %drupal to use the default username and password. This is not allowed for security reasons.',array('%drupal'=>drupal_install_profile_name())));
form_set_error('db_prefix',st('The database prefix you have entered, %db_prefix, is invalid. The database prefix can only contain alphanumeric characters and underscores.',array('%db_prefix'=>$db_prefix)),'error');
}
// Check database type
if(!isset($form)){
$db_type=substr($db_url,0,strpos($db_url,'://'));
}
$databases=drupal_detect_database_types();
if(!in_array($db_type,$databases)){
form_set_error('db_type',st("In your %settings_file file you have configured Drupal to use a %db_type server, however your PHP installation currently does not support this database type.",array('%settings_file'=>$settings_file,'%db_type'=>$db_type)));
form_set_error('db_type',st('In order for Drupal to work and to proceed with the installation process you must resolve all permission issues reported above. We were able to verify that we have permission for the following commands: %commands. For more help with configuring your database server, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.',array('%commands'=>implode($success,', '))));
printtheme('install_page','<p>We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process.</p>');
printtheme('install_page','<ul><li>To start over, you must empty your existing database.</li><li>To install to a different database, edit the appropriate <em>settings.php</em> file in the <em>sites</em> folder.</li><li>To upgrade an existing installation, proceed to the <a href="'.$base_url.'/update.php">update script</a>.</li></ul>');
$output=st('<p>Congratulations, %drupal has been successfully installed.</p>',array('%drupal'=>drupal_install_profile_name()));
// Show profile finalization info.
$function=$profile.'_profile_final';
if(function_exists($function)){
// More steps required
$output.=$function();
}
else{
// No more steps
$msg=drupal_set_message()?'Please review the messages above before continuing on to <a href="%url">your new site</a>.':'You may now visit <a href="%url">your new site</a>.';