public function DatabaseTasks_sqlite::validateDatabaseSettings

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

includes/database/sqlite/install.inc, line 36
SQLite specific install functions

Class

DatabaseTasks_sqlite

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!database!sqlite!install.inc/function/DatabaseTasks_sqlite::validateDatabaseSettings/7.x