Skip to content

Commit

Permalink
Move couchbase creds to couchbase.php
Browse files Browse the repository at this point in the history
  • Loading branch information
trondn committed Dec 10, 2012
1 parent 593a33e commit a3b70db
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ beers - by_name
Couchbase configuration
-----------------------

Edit the function getCouchbaseHandle in tools.php and add the list of
hostnames where your cluster is running.
Edit couchbase.php and set the correct values for the tunables.


TODO
Expand Down
9 changes: 9 additions & 0 deletions couchbase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/* This file contains the credentials used to access
* the Couchbase cluster.
*/
define("COUCHBASE_CONFIG_HOST", "10.0.0.33");
define("COUCHBASE_CONFIG_USER", "");
define("COUCHBASE_CONFIG_PASSWD", "");
define("COUCHBASE_CONFIG_BUCKET", "beer-sample");
?>
15 changes: 9 additions & 6 deletions tools.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php

include "couchbase.php";

function getCouchbaseHandle() {
return new Couchbase(array("192.168.0.61", "my-second-server", "my-third-server"),
"", // Username if needed
"", // Password if needed
"beer-sample", // Name of the bucket containing the data
true);
return new Couchbase(COUCHBASE_CONFIG_HOST,
COUCHBASE_CONFIG_USER,
COUCHBASE_CONFIG_PASSWD,
COUCHBASE_CONFIG_BUCKET,
true);
}

function getContext() {
Expand Down Expand Up @@ -36,7 +39,7 @@ function getStylesheets() {
}

function buildParamArray() {
$url = "";
$url = "";
foreach ($_SERVER["argv"] as $v) {
if ($url == "") {
$url = $v;
Expand Down

0 comments on commit a3b70db

Please sign in to comment.