public function __construct($settings) { $default_settings = array('encoding' => 'UNICODE'); parent::__construct(array_merge($default_settings, $settings)); if (!array_key_exists('hostname', $this->settings)) { throw new AnewtDatabaseConnectionException('Missing hostname in PostgreSQL connection settings.'); } if (!array_key_exists('username', $this->settings)) { throw new AnewtDatabaseConnectionException('Missing username in PostgreSQL connection settings.'); } if (!array_key_exists('password', $this->settings)) { throw new AnewtDatabaseConnectionException('Missing password in PostgreSQL connection settings.'); } if (!array_key_exists('database', $this->settings)) { throw new AnewtDatabaseConnectionException('Missing database in PostgreSQL connection settings.'); } }
public function __construct($settings) { $default_settings = array('filename' => ':memory:', 'mode' => 0666); parent::__construct(array_merge($default_settings, $settings)); }
public function __construct($settings) { $default_settings = array('connection' => null, 'hostname' => 'localhost', 'port' => 11211, 'socket' => null, 'expiry' => 600, 'identifier' => 'anewt-database', 'compression' => false); parent::__construct(array_merge($default_settings, $settings)); if (!$this->settings['connection'] instanceof AnewtDatabaseConnection) { throw new AnewtDatabaseConnectionException('Connection is not a valid AnewtDatabaseConnection.'); } $this->connection_handle = $this->settings['connection']; $this->memcache = new Memcache(); }