couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rene Veerman <rene.veerman.netherla...@gmail.com>
Subject Re: R: FYI : a new library for accessing couchdb through PHP, which i'm willing to upgrade, maintain and bugfix.
Date Sat, 06 Mar 2021 12:11:08 GMT
FYI : i had to upgrade https://github.com/skeyby/sag just a little bit,
adding the following to src/Sag.php :

  public function setAdmins($data) {
    return $this->procPacket ('PUT', '/'.$this->db.'/_security', $data);
  }

this is intended to be used as such :

$cdb = new Sag($cdbConfig['domain'], $cdbConfig['port']);
$cdb->setHTTPAdapter($cdbConfig['httpAdapter']);
$cdb->useSSL($cdbConfig['useSSL']);
$cdb->login($cdbConfig['adminUsername'], $cdbConfig['adminPassword']);
$cdb->setDatabase($cms->domain.'___analytics',true);
$json = '{ "admins": { "names": [], "roles": ["guests"] }, "members": {
"names": ["Administrator"], "roles": ["guests"] } }';
try {
    $call = $cdb->setAdmins ($json);
} catch (Exception $e) {
    echo '<pre style="color:red">'; var_dump ($e); echo '</pre>'; die();
}
echo 'Created database '.$cms->domain.'___analytics<br/>';

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message