ytake / Laravel-Couchbase

Couchbase providers for Laravel
MIT License
30 stars 22 forks source link

Compatibility for php71 and php-pecl-couchbase 2.3.x #41

Open pixelpeter opened 7 years ago

pixelpeter commented 7 years ago

With version 2.3.x of the php extension, the API of the PHP SDK has changed and only one parameter is allowed when constructing a CouchbaseCluster.

Documentation for 2.2.3 http://docs.couchbase.com/sdk-api/couchbase-php-client-2.2.3/classes/CouchbaseCluster.html

Documentation for 2.3.3 http://docs.couchbase.com/sdk-api/couchbase-php-client-2.3.3/classes/Couchbase.Cluster.html

The fix is simple in Ytake\LaravelCouchbase\Database\CouchbaseConnector

OLD:

    public function connect(array $servers)
    {
        $configure = array_merge($this->configure, $servers);

        return new CouchbaseCluster(
            $configure['host'],
            $configure['user'],
            $configure['password']
        );
    }

NEW:

    public function connect(array $servers)
    {
        $configure = array_merge($this->configure, $servers);

        return new CouchbaseCluster(
            $configure['host']
        );
    }

If this change is OK for you I can also provide it as a pull request

ytake commented 7 years ago

still a work in progress (for laravel5.5) https://github.com/ytake/Laravel-Couchbase/blob/feature/laravel-55/src/Database/CouchbaseConnector.php#L36

ytake commented 6 years ago

https://github.com/ytake/Laravel-Couchbase/releases/tag/1.0.0