laravel 的 couchbase 参数无效?

Invalid arguments for couchbase at laravel?

我有问题 laravel 5.4

我正在使用 mpociot/couchbase。 我建立了 php couchbase 和 php/pcs

的 couchbase 服务器和模块

但是我有以下错误。

(1/2) ErrorException
Couchbase\Cluster::__construct() expects exactly 1 parameter, 3 given

config/database.php

  'couchbase' => [
        'driver'   => 'couchbase',
        'host'     => 'localhost',
        'port'     => '8091',
        'bucket'   => 'travel-sample',
        'username' => '',
        'n1ql_hosts' => [
            'http://'.env('DB_HOST', 'localhost').':8093'
        ]
    ],

我哪里弄错了? 谢谢

  1. 沙发底座扩展不再需要 pcs
  2. src/Mpociot/Couchbase/Connection.php#L270中的构造函数应该写成

    $cluster = new Cluster($config['host']);
    if (!empty($config['user']) && !empty($config['password'])) {
        $cluster->authenticateAs(strval($config['user']), strval($config['password']));
    }
    return $cluster;
    

    这是在 Laravel 5.5 分支的 ytake/Laravel-Couchbase 中完成的。

这是 mpociot 存储库中的一个错误,不再受支持。

回购已移至 https://github.com/ORT-Interactive-GmbH/laravel-couchbase,我们支持此回购 ;)