Permalink
Browse files

Initial bucket API

Change-Id: I539edefb5d824815cda4eb6838cc6046eaeaeb43
Reviewed-on: http://review.couchbase.org/22014
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
  • Loading branch information...
1 parent a133a06 commit ac4d9a82fc1f4970313fb0a81ccd1c4ff9b41adb @trondn trondn committed with mnunberg Nov 8, 2012
View
@@ -170,5 +170,18 @@ if test "$PHP_COUCHBASE" != "no"; then
dnl PHP_ADD_LIBRARY(stdc++, 1, COUCHBASE_SHARED_LIBADD)
dnl PHP_ADD_LIBRARY(event, 1, COUCHBASE_SHARED_LIBADD)
PHP_SUBST(COUCHBASE_SHARED_LIBADD)
- PHP_NEW_EXTENSION(couchbase, compress.c couchbase.c views.c observe.c ht.c resmgr.c misc.c fastlz/fastlz.c timeout.c, $ext_shared)
+ PHP_NEW_EXTENSION([couchbase],
+ [compress.c \
+ couchbase.c \
+ fastlz/fastlz.c \
+ ht.c \
+ management/buckets.c \
+ management/instance.c \
+ management/management.c \
+ misc.c \
+ observe.c \
+ resmgr.c \
+ timeout.c \
+ views.c ],
+ [$ext_shared])
fi
View
@@ -7,7 +7,15 @@ if (PHP_COUCHBASE != "no") {
if (CHECK_LIB("libcouchbase.lib", "couchbase", PHP_COUCHBASE) &&
CHECK_HEADER_ADD_INCLUDE("couchbase.h", "CFLAGS_COUCHBASE", PHP_COUCHBASE+ ";" + PHP_PHP_BUILD + "\\include\\libcouchbase")) {
EXTENSION("couchbase", "couchbase.c", PHP_COUCHBASE_SHARED, "");
- ADD_SOURCES(configure_module_dirname, "views.c observe.c ht.c resmgr.c misc.c gettimeofday_win32.c compress.c timeout.c", "couchbase");
- ADD_SOURCES(configure_module_dirname + "\\fastlz", "fastlz.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "compress.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "gettimeofday_win32.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "ht.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "misc.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "observe.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "resmgr.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "timeout.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname, "views.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname + "\\fastlz", "fastlz.c", "couchbase");
+ ADD_SOURCES(configure_module_dirname + "\\management", "buckets.c instance.c management.c", "couchbase");
}
}
View
@@ -4170,6 +4170,8 @@ PHP_MINIT_FUNCTION(couchbase)
zend_declare_property_null(couchbase_ce, ZEND_STRL(COUCHBASE_PROPERTY_HANDLE), ZEND_ACC_PRIVATE TSRMLS_CC);
+ init_couchbase_cluster(module_number TSRMLS_CC);
+
return SUCCESS;
}
/* }}} */
View
@@ -0,0 +1,16 @@
+<?php
+
+$cb = new CouchbaseClusterManager("localhost", "Administrator", "password");
+
+$cb->createBucket("mybucket", array("type" => "couchbase",
+ "quota" => 256,
+ "replicas" => 1,
+ "enable flush" => 1,
+ "parallel compaction" => true,
+ "auth" => "none",
+ "port" => 11212));
+
+//$cb->modifyBucket("mybucket", array("auth" => "sasl",
+// "password" => "secret",
+// "port" => 11212));
+?>
View
@@ -60,8 +60,11 @@
#endif
#include "Zend/zend_API.h"
+#include <zend_exceptions.h>
#include "timeout.h"
+#include "management/cluster.h"
+#include "management/exceptions.h"
#endif
Oops, something went wrong.

0 comments on commit ac4d9a8

Please sign in to comment.