Commit 2cdd579c authored by Andreas Pohl's avatar Andreas Pohl

if $persistent=true, resource_type == 'SQLAnywhere persistent connnection ',

if $persistent=false, resource_type == 'SQLAnywhere connection'
parent c664ce7f
......@@ -50,7 +50,7 @@ class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection
{
$this->connection = $persistent ? @sasql_pconnect($dsn) : @sasql_connect($dsn);
if ( ! is_resource($this->connection) || get_resource_type($this->connection) !== 'SQLAnywhere connection') {
if ( ! is_resource($this->connection) || !preg_match('/^SQLAnywhere.*connection.*/',get_resource_type($this->connection)) ) {
throw SQLAnywhereException::fromSQLAnywhereError();
}
......
......@@ -74,7 +74,7 @@ class SQLAnywhereStatement implements IteratorAggregate, Statement
*/
public function __construct($conn, $sql)
{
if ( ! is_resource($conn) || get_resource_type($conn) !== 'SQLAnywhere connection') {
if ( ! is_resource($conn) || !preg_match('/^SQLAnywhere.*connection.*/',get_resource_type($conn))) {
throw new SQLAnywhereException('Invalid SQL Anywhere connection resource: ' . $conn);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment