You are here

public function Index::__construct in Drupal driver for SQL Server and SQL Azure 8

Same name and namespace in other branches
  1. 8.2 src/Indexes/Index.php \Drupal\sqlsrv\Indexes\Index::__construct()

Create an instance of Index.

Parameters

mixed $uri :

Throws

\Exception

File

src/Indexes/Index.php, line 22

Class

Index
Represents a database Index.

Namespace

Drupal\sqlsrv\Indexes

Code

public function __construct($uri) {
  $name = pathinfo($uri, PATHINFO_FILENAME);
  $parts = explode('@', basename($name));
  if (count($parts) != 2) {
    throw new \Exception('Incorrect SQL index file name format.');
  }
  $this->table = $parts[0];
  $this->name = $parts[1];
  $this->code = file_get_contents($uri);
}