|
178 | 178 | */
|
179 | 179 | const COUCHBASE_REPLICA_SELECT = LCB_REPLICA_SELECT;
|
180 | 180 |
|
| 181 | +/** |
| 182 | + * A class representing a connection to a Couchbase bucket. |
| 183 | + */ |
181 | 184 | class Couchbase {
|
182 | 185 |
|
183 | 186 | /**
|
| 187 | + * Constructs a new instance of a Couchbase object. |
184 | 188 | *
|
185 | 189 | * @param array $hosts An array of hostnames[:port] where the
|
186 | 190 | * Couchbase cluster is running. The port number is
|
@@ -974,6 +978,12 @@ function listDesignDocs() {
|
974 | 978 |
|
975 | 979 | }
|
976 | 980 |
|
| 981 | +/** |
| 982 | + * A class to wrap the management of a Couchbase cluster. |
| 983 | + * |
| 984 | + * Provides APIs for managing a Couchbase cluster, including the creation, |
| 985 | + * deletion and modification of buckets. |
| 986 | + */ |
977 | 987 | class CouchbaseClusterManager {
|
978 | 988 |
|
979 | 989 | /**
|
@@ -1099,46 +1109,84 @@ function flushBucket($name) {
|
1099 | 1109 | // //
|
1100 | 1110 | ////////////////////////////////////////////////////////
|
1101 | 1111 |
|
| 1112 | +/** |
| 1113 | + * The base Couchbase Exception class which all Couchbase Exceptions |
| 1114 | + * inherit from. |
| 1115 | + */ |
1102 | 1116 | class CouchbaseException extends Exception {
|
1103 | 1117 |
|
1104 | 1118 | }
|
1105 | 1119 |
|
| 1120 | +/** |
| 1121 | + * Exception thrown when an invalid key is passed |
| 1122 | + */ |
1106 | 1123 | class CouchbaseIllegalKeyException extends CouchbaseException {
|
1107 | 1124 |
|
1108 | 1125 | }
|
1109 | 1126 |
|
| 1127 | +/** |
| 1128 | + * Exception thrown when the server determines the requested key does not |
| 1129 | + * exist. |
| 1130 | + */ |
1110 | 1131 | class CouchbaseNoSuchKeyException extends CouchbaseException {
|
1111 | 1132 |
|
1112 | 1133 | }
|
1113 | 1134 |
|
| 1135 | +/** |
| 1136 | + * Exception thrown when authentication with the server fails. |
| 1137 | + */ |
1114 | 1138 | class CouchbaseAuthenticationException extends CouchbaseException {
|
1115 | 1139 |
|
1116 | 1140 | }
|
1117 | 1141 |
|
| 1142 | +/** |
| 1143 | + * Exception thrown on internal libcouchbase errors. |
| 1144 | + */ |
1118 | 1145 | class CouchbaseLibcouchbaseException extends CouchbaseException {
|
1119 | 1146 |
|
1120 | 1147 | }
|
1121 | 1148 |
|
| 1149 | +/** |
| 1150 | + * Exception thrown when the server encounters an error. |
| 1151 | + */ |
1122 | 1152 | class CouchbaseServerException extends CouchbaseException {
|
1123 | 1153 |
|
1124 | 1154 | }
|
1125 | 1155 |
|
| 1156 | +/** |
| 1157 | + * Exception thrown when the CAS value you passed does not match the servers |
| 1158 | + * current value. |
| 1159 | + */ |
1126 | 1160 | class CouchbaseKeyMutatedException extends CouchbaseException {
|
1127 | 1161 |
|
1128 | 1162 | }
|
1129 | 1163 |
|
| 1164 | +/** |
| 1165 | + * Exception thrown when an operation times out. |
| 1166 | + */ |
1130 | 1167 | class CouchbaseTimeoutException extends CouchbaseException {
|
1131 | 1168 |
|
1132 | 1169 | }
|
1133 | 1170 |
|
| 1171 | +/** |
| 1172 | + * Exception thrown when there are not enough nodes online to preform a |
| 1173 | + * particular operation. Generally occurs due to invalid durability |
| 1174 | + * requirements |
| 1175 | + */ |
1134 | 1176 | class CouchbaseNotEnoughNodesException extends CouchbaseException {
|
1135 | 1177 |
|
1136 | 1178 | }
|
1137 | 1179 |
|
| 1180 | +/** |
| 1181 | + * Exception thrown when an illegal option is passed to a method. |
| 1182 | + */ |
1138 | 1183 | class CouchbaseIllegalOptionException extends CouchbaseException {
|
1139 | 1184 |
|
1140 | 1185 | }
|
1141 | 1186 |
|
| 1187 | +/** |
| 1188 | + * Exception thrown when an illegal value is passed to a method. |
| 1189 | + */ |
1142 | 1190 | class CouchbaseIllegalValueException extends CouchbaseException {
|
1143 | 1191 |
|
1144 | 1192 | }
|
0 commit comments