You are here

protected function MigrateSourceOracle::connect in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 plugins/sources/oracle.inc \MigrateSourceOracle::connect()

Connect lazily to the DB server.

2 calls to MigrateSourceOracle::connect()
MigrateSourceOracle::computeCount in plugins/sources/oracle.inc
Return a count of all available source records.
MigrateSourceOracle::performRewind in plugins/sources/oracle.inc
Implementation of MigrateSource::performRewind().

File

plugins/sources/oracle.inc, line 96
Define a MigrateSource class for importing from Oracle databases.

Class

MigrateSourceOracle
Implementation of MigrateSource, to handle imports from remote Oracle servers.

Code

protected function connect() {
  if (!isset($this->connection)) {
    if (!extension_loaded('oci8')) {
      throw new Exception(t('You must configure the oci8 extension in PHP.'));
    }
    $this->connection = oci_connect($this->configuration['username'], $this->configuration['password'], $this->configuration['connection_string'], $this->characterSet);
  }
  if ($this->connection) {
    return TRUE;
  }
  else {
    $e = oci_error();
    throw new Exception($e['message']);
    return FALSE;
  }
}