/dev/adei/adei-couchreader

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei/adei-couchreader

« back to all changes in this revision

Viewing changes to classes/readers/couchreader.php

  • Committer: Nicholas Tan Jerome
  • Date: 2014-07-31 09:36:06 UTC
  • Revision ID: nicholas.jerome@kit.edu-20140731093606-o9lcntt6lzjkeukq
added a fix to URL without port, such as from cloudant

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
 
240
240
        # credentials
241
241
        $credential = "";
242
 
        if ($username && $password ) {
 
242
        if ($username && $password) {
243
243
            $credential = implode(":", array($username,
244
244
                                             $password));
245
245
            $credential = $credential."@";
246
246
        }
247
247
 
 
248
        # ports
 
249
        if ($port) {
 
250
            $port = ":".$port;
 
251
        }
 
252
 
248
253
        # build URL for queries
249
254
        $this->base_view_url = implode("", array($http_method."://",
250
255
                                            $credential,
251
 
                                            $host.":",
 
256
                                            $host,
252
257
                                            $port."/",
253
258
                                            $database."/",
254
259
                                            "_design/",
257
262
 
258
263
        $this->base_url = implode("", array($http_method."://",
259
264
                                            $credential,
260
 
                                            $host.":",
 
265
                                            $host,
261
266
                                            $port."/",
262
267
                                            $database."/"));
263
268