UnionOfRAD / lithium

li₃ is the fast, flexible and most RAD development framework for PHP
http://li3.me
BSD 3-Clause "New" or "Revised" License
1.22k stars 237 forks source link

couchdb 2.3 is not working with lithium #1338

Open alexanderhaensch opened 5 years ago

alexanderhaensch commented 5 years ago

In case of Couchdb 2.3 the method: $this->connection->{$method}($path, $data, $options); in https://github.com/UnionOfRAD/lithium/blob/bec3f4fdf61ea5002904754f43941ad1430ecec7/data/source/http/adapter/CouchDb.php#L122 is an array instead of string..

This breaks the logic inside of the describe function.

alexanderhaensch commented 5 years ago

possible workaround, that works with couchdb 1.x and 2.3:

                $result = $this->connection->{$method}($path, $data, $options);
                if (is_array($result)) {
                        return (object) $result;
                }
                else{
                        return json_decode($result);
                }