public function DatabaseTasks_sqlite::validateDatabaseSettings
7.x install.inc | public DatabaseTasks_sqlite::validateDatabaseSettings($database) |
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
- drupal-7.x/
includes/ database/ sqlite/ install.inc, line 38 - SQLite specific install functions
Class
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;
}