SqlVersion.php

  1. 8.0.x lib/Drush/Sql/SqlVersion.php
  2. 7.x lib/Drush/Sql/SqlVersion.php
  3. master lib/Drush/Sql/SqlVersion.php

Namespace

Drush\Sql

Classes

Namesort descending Description
SqlVersion

File

lib/Drush/Sql/SqlVersion.php
View source
  1. <?php
  2. namespace Drush\Sql;
  3. use Drush\Log\LogLevel;
  4. class SqlVersion {
  5. /*
  6. * Determine $db_spec by inspecting the global environment (D6/7) or the DB API (D8+).
  7. *
  8. * @return array $db_spec
  9. * An array specifying a database connection.
  10. */
  11. public function get_db_spec() {}
  12. /*
  13. * Return all configured DB connections by inspecting the global environment (D6/7) or the DB API (D8+).
  14. *
  15. * @return array $all
  16. * An array specifying one or more database connections.
  17. */
  18. public function getAll() {}
  19. /*
  20. * Validate that Drupal can connect to the DB without actually using Drupal to do so. Called
  21. * by drush_valid_db_credentials().
  22. */
  23. public function valid_credentials($db_spec) {
  24. // Drupal >=7 requires PDO and Drush requires php 5.4+ which ships with PDO
  25. // but it may be compiled with --disable-pdo.
  26. if (!class_exists('\PDO')) {
  27. drush_log(dt('PDO support is required.'), LogLevel::BOOTSTRAP);
  28. return FALSE;
  29. }
  30. return TRUE;
  31. }
  32. }