From f5b70bd6d167df04cc79576559e5de66b65e882d Mon Sep 17 00:00:00 2001 From: Gael Millet Date: Fri, 31 Mar 2017 12:01:42 +0200 Subject: [PATCH] Fix errors with driver 1.3.0 --- .travis.yml | 9 +++++---- composer.json | 4 ++-- src/Cassandra/Client.php | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index e29549b..78c0d89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,14 @@ language: php php: - - 5.5 + - 5.6 - 7.0 - 7.1 env: - SYMFONY_VERSION="~2.3.0" - SYMFONY_VERSION="~2.7.0" - - SYMFONY_VERSION="~3.0.0" + - SYMFONY_VERSION="~3.2.0" branches: only: @@ -20,8 +20,9 @@ before_install: # PPA for libuv-dev - sudo apt-add-repository ppa:linuxjedi/ppa -y - sudo apt-get update - - sudo apt-get install -y libuv-dev libssl-dev - - cd /tmp && git clone https://github.com/datastax/php-driver.git && cd php-driver && git checkout v1.2.2 && git submodule update --init + - sudo apt-get install -y libssl-dev + - cd /tmp && wget https://github.com/libuv/libuv/archive/v1.11.0.tar.gz && tar -xvzf v1.11.0.tar.gz && cd libuv-1.11.0 && sh autogen.sh && ./configure && sudo make && sudo make install && sudo ldconfig + - cd /tmp && git clone https://github.com/datastax/php-driver.git && cd php-driver && git checkout master && git submodule update --init - cd ext && ./install.sh && cd "$TRAVIS_BUILD_DIR" - echo "extension=cassandra.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` diff --git a/composer.json b/composer.json index 35de7bb..85a13f7 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,8 @@ } ], "require": { - "php": ">=5.5", - "ext-cassandra": "<1.3.0" + "php": ">=5.6", + "ext-cassandra": "^1.3.0" }, "require-dev": { "atoum/atoum": "^2.8||^3.0", diff --git a/src/Cassandra/Client.php b/src/Cassandra/Client.php index cec0f39..ec1b3da 100644 --- a/src/Cassandra/Client.php +++ b/src/Cassandra/Client.php @@ -136,7 +136,7 @@ public function getSession() * * @return \Cassandra\Rows execution result */ - public function execute(Statement $statement, ExecutionOptions $options = null) + public function execute($statement, $options = null) { return $this->send('execute', [$statement, $options]); } @@ -152,7 +152,7 @@ public function execute(Statement $statement, ExecutionOptions $options = null) * * @return \Cassandra\Future future result */ - public function executeAsync(Statement $statement, ExecutionOptions $options = null) + public function executeAsync($statement, $options = null) { return $this->send('executeAsync', [$statement, $options]); } @@ -170,7 +170,7 @@ public function executeAsync(Statement $statement, ExecutionOptions $options = n * * @return PreparedStatement prepared statement */ - public function prepare($cql, ExecutionOptions $options = null) + public function prepare($cql, $options = null) { return $this->send('prepare', [$cql, $options]); } @@ -185,7 +185,7 @@ public function prepare($cql, ExecutionOptions $options = null) * * @return \Cassandra\Future statement */ - public function prepareAsync($cql, ExecutionOptions $options = null) + public function prepareAsync($cql, $options = null) { return $this->send('prepareAsync', [$cql, $options]); } @@ -321,4 +321,12 @@ protected function send($command, array $arguments) return $this->prepareResponse($return, $event); } + + /** + * @return array Performance/Diagnostic metrics. + */ + public function metrics() + { + return $this->getSession()->metrics(); + } }