You are here

public static function Tasks::InstallRequirements in Drupal driver for SQL Server and SQL Azure 8.2

Return the install requirements for both the status page and the install process.

2 calls to Tasks::InstallRequirements()
sqlsrv_requirements in ./sqlsrv.install
Implements hook_requirements().
Tasks::checkRequirements in drivers/lib/Drupal/Driver/Database/sqlsrv/Install/Tasks.php
Check for general requirements

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Install/Tasks.php, line 204
Definition of Drupal\Driver\Database\sqlsrv\Tasks

Class

Tasks
Specifies installation tasks for PostgreSQL databases.

Namespace

Drupal\Driver\Database\sqlsrv\Install

Code

public static function InstallRequirements() {

  // Array of requirement errors.
  $errors = [];

  #region check for MS SQL PDO version and client buffer size
  $sqlsrv_extension_data = Utils::ExtensionData('pdo_sqlsrv');

  // Version.
  $version_ok = version_compare($sqlsrv_extension_data
    ->Version(), '3.2') >= 0;
  $requirements['sqlsrv_pdo'] = array(
    'title' => t('MSSQL Server PDO extension'),
    'severity' => $version_ok ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    'value' => t('@level', array(
      '@level' => $sqlsrv_extension_data
        ->Version(),
    )),
    'description' => t('Use at least the 3.2.0.0 version of the MSSQL PDO driver.'),
  );

  // Client buffer size.
  $buffer_size = $sqlsrv_extension_data
    ->IniEntries()['pdo_sqlsrv.client_buffer_max_kb_size'];
  $buffer_size_min = 12240 * 2;
  $buffer_size_ok = $buffer_size >= $buffer_size_min;
  $errors['sqlsrv_client_buffer_size'] = array(
    'title' => t('MSSQL Server client buffer size'),
    'severity' => $buffer_size_ok ? REQUIREMENT_OK : REQUIREMENT_WARNING,
    'value' => "{$buffer_size} Kb",
    'description' => "pdo_sqlsrv.client_buffer_max_kb_size setting must be of at least {$buffer_size_min}Kb. Currently {$buffer_size}Kb.",
  );
  return $errors;
}