Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix stale queries #10

Merged
merged 1 commit into from

2 participants

@radmiraal

Stale queries didn't work as the argument value was json_encoded
and thus not recognized as being "ok" or "update_ok" by CouchDB.
This change introduces an exception just for the 'stale' argument.

@radmiraal radmiraal Fix stale queries
Stale queries didn't work as the argument value was json_encoded
and thus not recognized as being "ok" or "update_ok" by CouchDB.
This change introduces an exception just for the 'stale' argument.
b8f7265
@beberlei beberlei merged commit 94af7c0 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2013
  1. @radmiraal

    Fix stale queries

    radmiraal authored
    Stale queries didn't work as the argument value was json_encoded
    and thus not recognized as being "ok" or "update_ok" by CouchDB.
    This change introduces an exception just for the 'stale' argument.
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/Doctrine/CouchDB/View/Query.php
View
11 lib/Doctrine/CouchDB/View/Query.php
@@ -36,12 +36,21 @@ protected function createResult($response)
protected function getHttpQuery()
{
+ $arguments = array();
+ foreach ($this->params as $key => $value) {
+ if ($key === 'stale') {
+ $arguments[$key] = $value;
+ } else {
+ $arguments[$key] = json_encode($value);
+ }
+ }
+
return sprintf(
"/%s/_design/%s/_view/%s?%s",
$this->databaseName,
$this->designDocumentName,
$this->viewName,
- http_build_query( array_map( "json_encode", $this->params ) )
+ http_build_query($arguments)
);
}
Something went wrong with that request. Please try again.