Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

drush_sql_version_server

Definition

drush_sql_version_server()
contributions/drush/drush_sql/drush_sql.module, line 64

Description

Command callback. Displays the MySQL or PostgreSQL server version number.

Code

<?php
function drush_sql_version_server() {
  switch (_drush_sql_get_scheme()) {
    case 'mysql':
    case 'mysqli':
      drush_print(mysql_get_server_info());
      break;
    case 'pgsql':
      // NOTE: apparently the server version is only available if PHP was
      // compiled with PostgreSQL 7.4 or later, so we'll fall back to
      // displaying the client version if that's the case.
      $info = pg_version();
      drush_print(isset($info['server_version']) ? $info['server_version'] : $info['client']);
      break;
    default:
      drush_die(_drush_sql_get_invalid_url_msg());
  }
}
?>