public function DatabaseTasks_sqlite::validateDatabaseSettings in Drupal 7
Validates driver specific configuration settings.
Checks to ensure correct basic database settings and that a proper connection to the database can be established.
Parameters
$database: An array of driver specific configuration options.
Return value
An array of driver configuration errors, keyed by form element name.
Overrides DatabaseTasks::validateDatabaseSettings
File
- includes/
database/ sqlite/ install.inc, line 36 - SQLite specific install functions
Class
- DatabaseTasks_sqlite
- @file SQLite specific install functions
Code
public function validateDatabaseSettings($database) {
// Perform standard validation.
$errors = parent::validateDatabaseSettings($database);
// Verify the database is writable.
$db_directory = new SplFileInfo(dirname($database['database']));
if (!$db_directory
->isWritable()) {
$errors[$database['driver'] . '][database'] = st('The directory you specified is not writable by the web server.');
}
return $errors;
}