Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: PHP ${{ matrix.php-versions }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.php-versions >= '8.5' }}
continue-on-error: ${{ matrix.php-versions >= '8.6' }}
strategy:
fail-fast: false
matrix:
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
os: [ubuntu-latest, windows-latest]

steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:

- name: Install dependencies
run: >
curl -sSL https://baltocdn.com/xp-framework/xp-runners/distribution/downloads/e/entrypoint/xp-run-8.8.0.sh > xp-run &&
curl -sSL https://github.com/xp-runners/reference/releases/download/v9.3.0/xp-run-9.3.0.sh > xp-run &&
composer install --prefer-dist &&
echo "vendor/autoload.php" > composer.pth

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ init:
install:
- if exist .\xp (set CACHED=1) else (mkdir .\xp)
- if %CACHED%==0 cd .\xp
- if %CACHED%==0 curl -fsS -o php.zip https://windows.php.net/downloads/releases/archives/php-8.2.15-nts-Win32-vs16-x64.zip
- if %CACHED%==0 curl -fsS -o php.zip https://downloads.php.net/~windows/releases/archives/php-8.2.15-nts-Win32-vs16-x86.zip
- if %CACHED%==0 appveyor DownloadFile https://getcomposer.org/composer.phar
- if %CACHED%==0 appveyor DownloadFile https://baltocdn.com/xp-framework/xp-runners/distribution/downloads/z/zip/xp-runners_8.8.0.zip -FileName xp.zip
- if %CACHED%==0 appveyor DownloadFile https://github.com/xp-runners/reference/releases/download/v9.3.0/xp-runners_9.3.0.zip -FileName xp.zip
- if %CACHED%==0 7z x php.zip -y
- if %CACHED%==0 7z x xp.zip -y
- if %CACHED%==0 cd ..
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"description" : "RDBMS support for the XP Framework",
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^12.0 | ^11.0 | ^10.0 | ^9.0 | ^8.0 | ^7.0",
"xp-framework/core": "^12.11 | ^11.11",
"xp-framework/logging": "^11.0 | ^10.0 | ^9.0 | ^8.0 | ^7.0",
"xp-framework/networking": "^10.0 | ^9.0 | ^8.0 | ^7.0",
"xp-framework/networking": "^11.0 | ^10.0 | ^9.3",
"xp-framework/math": "^10.0 | ^9.0 | ^8.0 | ^7.0",
"php" : ">=7.0.0"
},
Expand Down
10 changes: 5 additions & 5 deletions src/main/php/rdbms/mysqlx/MySqlxConnection.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace rdbms\mysqlx;

use io\IOException;
use io\OperationFailed;
use lang\XPClass;
use peer\Socket;
use rdbms\mysql\MysqlDialect;
Expand Down Expand Up @@ -70,7 +70,7 @@ public function connect($reconnect= false) {
try {
$this->handle->connect($this->dsn->getUser(), $this->dsn->getPassword());
$this->_obs && $this->notifyObservers(new DBEvent(DBEvent::CONNECTED, $reconnect));
} catch (IOException $e) {
} catch (OperationFailed $e) {
$this->handle->connected= null;
$this->_obs && $this->notifyObservers(new DBEvent(DBEvent::CONNECTED, $reconnect));
throw new SQLConnectException($e->getMessage(), $this->dsn);
Expand All @@ -84,7 +84,7 @@ public function connect($reconnect= false) {
// "modes is a list of different modes separated by comma (,) characters."
$query= $this->handle->consume($this->handle->query("show variables like 'sql_mode'"));
$modes= array_flip(explode(',', $query[0][1]));
} catch (IOException $e) {
} catch (OperationFailed $e) {
// Ignore
}

Expand Down Expand Up @@ -121,7 +121,7 @@ public function selectdb($db) {
try {
$this->handle->exec('use '.$db);
return true;
} catch (IOException $e) {
} catch (OperationFailed $e) {
throw new SQLStatementFailedException($e->getMessage());
}
}
Expand Down Expand Up @@ -176,7 +176,7 @@ protected function query0($sql, $buffered= true) {
default:
throw new SQLStatementFailedException($message, $sql, $e->error);
}
} catch (IOException $e) {
} catch (OperationFailed $e) {
$this->close();
$this->transaction= 0;
throw new SQLConnectionClosedException($e->getMessage(), $tries, $sql, -1);
Expand Down
4 changes: 2 additions & 2 deletions src/main/php/rdbms/mysqlx/MySqlxProtocol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(Socket $s) {
*
* @param string user
* @param string user
* @throws io.IOException
* @throws io.OperationFailed
*/
public function connect($user= '', $password= '') {
$this->sock->isConnected() || $this->sock->connect();
Expand Down Expand Up @@ -159,7 +159,7 @@ public function close() {

try {
$this->write(chr(self::COM_QUIT));
} catch (\io\IOException $ignored) {
} catch (\io\OperationFailed $ignored) {
// Can't do much here
}
$this->sock->close();
Expand Down
4 changes: 2 additions & 2 deletions src/main/php/rdbms/mysqlx/NamedPipe.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace rdbms\mysqlx;

use io\{File, IOException};
use io\{File, OperationFailed};
use peer\Socket;

/**
Expand Down Expand Up @@ -53,7 +53,7 @@ public function newInstance($socket= null) {
if (null === $socket) $socket= $this->locate();

if (!($fd= fopen($socket, 'r+'))) {
$e= new IOException('Cannot open pipe "'.$socket.'"');
$e= new OperationFailed('Cannot open pipe "'.$socket.'"');
\xp::gc(__FILE__);
throw $e;
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/php/rdbms/tds/TdsConnection.class.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php namespace rdbms\tds;

use io\IOException;
use io\OperationFailed;
use peer\Socket;
use rdbms\{DBConnection, DBEvent, QuerySucceeded, SQLConnectException, SQLConnectionClosedException, SQLDeadlockException, SQLStateException, SQLStatementFailedException, StatementFormatter, Transaction};
use rdbms\mssql\MsSQLDialect;
use rdbms\{DBConnection, DBEvent, QuerySucceeded, SQLConnectException, SQLConnectionClosedException, SQLDeadlockException, SQLStateException, SQLStatementFailedException, StatementFormatter, Transaction};

/**
* Connection to MSSQL Databases via TDS
Expand Down Expand Up @@ -56,7 +56,7 @@ public function connect($reconnect= false) {
try {
$this->handle->connect($this->dsn->getUser(), $this->dsn->getPassword(), $this->dsn->getProperty('charset', null));
$this->_obs && $this->notifyObservers(new DBEvent(DBEvent::CONNECTED, $reconnect));
} catch (IOException $e) {
} catch (OperationFailed $e) {
$this->handle->connected= null;
$this->_obs && $this->notifyObservers(new DBEvent(DBEvent::CONNECTED, $reconnect));
$message= '';
Expand Down Expand Up @@ -91,7 +91,7 @@ public function selectdb($db) {
try {
$this->handle->exec('use '.$db);
return true;
} catch (IOException $e) {
} catch (OperationFailed $e) {
throw new SQLStatementFailedException($e->getMessage());
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ protected function query0($sql, $buffered= true) {
default: // Other error
throw new SQLStatementFailedException($message, $sql, $e->number);
}
} catch (IOException $e) {
} catch (OperationFailed $e) {
if (0 === $this->transaction && $this->connections->retry($this, $tries)) {
$tries++;
goto retry;
Expand Down
6 changes: 3 additions & 3 deletions src/main/php/rdbms/tds/TdsProtocol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ protected abstract function defaultPacketSize();
*
* @param string user
* @param string password
* @throws io.IOException
* @throws io.OperationFailed
*/
protected abstract function login($user, $password);

Expand Down Expand Up @@ -472,7 +472,7 @@ protected function handleEnvChange($type, $old, $new, $initial= false) {
* @param string user
* @param string password
* @param string charset
* @throws io.IOException
* @throws io.OperationFailed
*/
public function connect($user= '', $password= '', $charset= null) {
$this->connected= false;
Expand Down Expand Up @@ -661,7 +661,7 @@ public function close() {

try {
$this->stream->write(self::MSG_LOGOFF, "\0");
} catch (\io\IOException $ignored) {
} catch (\io\OperationFailed $ignored) {
// Can't do much here
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/php/rdbms/tds/TdsV5Protocol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected function defaultPacketSize() { return 512; }
* @param string user
* @param string password
* @param string charset
* @throws io.IOException
* @throws io.OperationFailed
*/
protected function login($user, $password, $charset= null) {
if (strlen($password) > 253) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/rdbms/tds/TdsV7Protocol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function defaultPacketSize() { return 4096; }
* @param string user
* @param string password
* @param string charset
* @throws io.IOException
* @throws io.OperationFailed
*/
protected function login($user, $password, $charset= null) {
$params= [
Expand Down
Loading