From 645db300a54c447f43f2d0407f7ea9c45ebeb67e Mon Sep 17 00:00:00 2001 From: reedgz Date: Sat, 20 Jun 2015 20:28:25 -0400 Subject: [PATCH] support query parameters in path like [comments.json?orderBy="user_id"&startAt="6"&endAt="6"] --- src/firebaseLib.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/firebaseLib.php b/src/firebaseLib.php index 099db81..c8e723e 100644 --- a/src/firebaseLib.php +++ b/src/firebaseLib.php @@ -80,10 +80,25 @@ public function setBaseURI($baseURI) */ private function _getJsonPath($path) { + /* $url = $this->_baseURI; $path = ltrim($path, '/'); $auth = ($this->_token == '') ? '' : '?auth=' . $this->_token; return $url . $path . '.json' . $auth; + */ + // changed by Reed + // support query parameters + $baseUrl = $this->_baseURI; + $path = ltrim($path, '/'); + + if(strpos($path,'?')){ + $auth = '&auth=' . $this->_token; + $url = $baseUrl. $path . $auth; + }else{ + $auth = '.json?auth=' . $this->_token; + $url = $baseUrl. $path . $auth; + } + return $url; } /**