This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
CHANGELOG
324 lines (229 loc) · 12.4 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
Sag Changes
===========
Version 0.9.0
-------------
Breaking Changes
* Default to cURL HTTP adapter instead of the native PHP implementation. The
cURL adapter is faster, more stable, and supports SSL.
New Features
* Support for PHP's strict mode. Strict mode is now turned on by default in
PHP as of v5.4.
* Added $skip to Sag->getAllDocs(), which was introduced in CouchDB 1.6.0.
(closes #80 #81)
Fixed Bugs
* Fixed response parsing bug in the cURL HTTP adapter for when HTTP bodies
are received that have empty lines. For example, if a view returns zero
results there is an empty line in the JSON that is returned. (closes #72)
* Fixed parsing of set-cookie header to be case insensitive. (closes #77)
* Fixed following redirects with the cURL HTTP adapter if PHP's open_basedir
php.ini variable is set. (closes #78)
Version 0.8.0
-------------
Breaking Changes
* Header keys are automatically lower cased now, whereas they previously kept
their capitalization. Unfortunately different API endpoints would sometimes
capitalize header names different (ex., Etag vs. ETag). Additionally,
BigCouch and Cloudant sometimes have different header capitalization. So,
whereas previously you might have done `$response->headers->Cookie` you
must now do `$response->headers->cookie`.
* We no longer check the PHP install's configuration for a our supported
error_reporting level. This is because too many different types of installs
were causing false positives and false negatives, needlessly breaking
installs. (closes #39)
* Added official support for CouchDB 1.2.x.
* Dropped official support for CouchDB 1.1.x.
New Features
* Support for setPathPrefix() from Sag-JS v0.3.0. Allows you to prepend all
URLs with a string, which is especially useful when going through a proxy.
Fixed Bugs
* SagNativeHTTPAdapter now supports and follows Location headers. (closes
#37)
* SagNativeHTTPAdapter's fgets() call no longer hangs on large responses that
are not chunked encoded. This was fixed by providing a line length. Thanks
to skyshard (github/skyshard) for helping with the debug. (closes #41)
* Sag no longer uses ternary short hand that was introduced in PHP 5.3, so
now PHP 5.2 will run without errors. Thanks to Jim Tittsler (github/jimt)
for reporting and submitting the patch. (closes #43)
* Disabled cache sizing for SagMemoryCache due to PHP's memory monitoring
being unreliable. The memory cache is no longer capped by Sag. (closes #22)
* Fixing an issue where the SagHTTPAdapter class's file wasn't being required
properly, causing class not found exceptions.
* No longer redirecting when the server returns a Location header with a 2xx
response. We now only do that redirect on a 3xx header. (Thanks to Greg
Nacu for reporting.)
* We now prevent cURL from sending a "Expect: 100-continue" header, as our
parsing code doesn't support HTTP/1.1's Continue. See
https://github.com/sbisbee/sag/pull/51 for a discussion. (Thanks to Greg
Nacu for reporting and working on this issue.)
Version 0.7.1
-------------
Fixed Bugs
* The cURL HTTP library was choking on a HTTP/1.1 Continue header. Only some
installations were running into this problem, depending on their cURL
configuration and version.
Version 0.7.0
-------------
New Features
* The HTTP socket code was abstracted out of the core Sag class into its own
HTTP module. It is called SagNativeHTTPAdapter and remains the default
transport mechanism. This allows for drivers to be written that leverage
different HTTP libraries, potentially adding extra functionality. The
SagNativeHTTPAdapter is referenced by the Sag::$HTTP_NATIVE_SOCKETS static
public variable and can be specified with the setHTTPAdapter() function.
(closes #12)
* cURL can now be used when communicating with CouchDB, allowing for
additional functionality. If your system has the cURL PHP extension
installed then you can tell Sag to use it by calling
`$sag->setHTTPAdapter(Sag::$HTTP_CURL);`.
* SSL is now supported if you use cURL instead of native sockets. This
introduces setSSL() to turn SSL on/off, and setSSLCert() to specify a
certificate file to verify against. Verification is only supported if you
provide a certificate with setSSLCert(). HTTP libraries that do not support
SSL (ie., native sockets) will throw a SagException if you call an SSL
function.
* You can now tell getAllDocs() to sort in descending order. Thanks to cygal
(github/cygal) for the patch and pull request. (closes #31)
Fixed Bugs
* If you set the database name and then set it again with the same value, but
also specify to create the database if it doesn't exist, Sag was previously
not checking to see if it should create the database. This is not fixed:
even if you specify the currentDatabase() value as the name the check will
still run. (closes #33)
Version 0.6.1
-------------
Fixed Bugs
* Fixed a typo bug where I was trying to throw the concept of an Exception
instead of an instantiation. Luckily it is rare for this corner case in the
code to run. Thanks to Oliver Kurowski (github/a4mc) for reporting.
(closes #26)
* Fixed a problem with the HTTP/1.1 decoding of chunked message bodies that
was causing continuous change feed requests (/db/_changes?continuous=true)
to fail. (closes #27)
* Fixed a typo bug in examples/phpSessions, changed createdOn to createdAt.
Thanks to Yo-Han (github/yo-han) for finding the bug and submitting the
patch as a pull request. (closes #28)
Version 0.6.0
-------------
Breaking Changes
* The HTTP status was incorrectly being added to the root of the response
object in addition to where it belongs in `$resp->headers->_HTTP->status`.
It is now removed. Applications that were using it at the `$resp->status`
should fix their code to use the proper location.
New Features
* Sag's internals now use HTTP/1.1 instead of HTTP/1.0. This requires zero
code changes for your application because Sag's interface is not impacted
by this.
* You can now set cookies that will be sent with every request using
setCookie(), and retrieve them with getCookie().
* SagUserUtils is the first of several utility classes that will be added to
Sag. It gently wraps the Sag interface to make managing CouchDB users much
easier. You can create and get users, and change their password.
* An example of how to proxy the cookie based auth's AuthSession cookie from
your PHP layer to CouchDB, making it easier to have user accounts in your
application without rewriting user management yet again.
* Support for the server level _session object with getSession(). Thanks to
Tim Juravich for the original patch.
Fixed Bugs
* As of CouchDB 1.1.0 inline attachments are sent as multipart HTTP
responses, which was breaking our parser. This is now fixed by always
sending an Accept header for 'application/json'. Thanks to Rob Newson and
Dale Harvey in #couchdb for helping on this. (closes #23)
* Previously an HTTP response code >=400 to a HEAD request would not throw a
SagCouchException because there was no error property in the message body
(because HEAD responses do not have bodies). Now a SagCouchException is
thrown as expected with the exception's code set to the HTTP response code.
This also creates a slight performance boost for parsing HEAD requests.
* When calling setDatabase() and specifying to create the database if it does
not already exist, the logic now uses a HEAD request instead of a GET. This
was a typo/mistake at the time, so it is getting bug status.
Version 0.5.1
-------------
Fixed Bugs
* Previously PUT was caching CouchDB's response, which created unexpected
results (the actual data being POST'd was expected to be cached). This is
now fixed: that data provided to post() is combined with the server's
response to create a cacheable object whose headers will not be entirely
accurate. POST is still not cached because CouchDB does not respond with an
E-tag to cache against. Thanks to Peter Kruithof for reporting and original
patch. (closes #17)
* setAttachment() now properly URL encodes the ?rev parameter when you
specify the document's _rev (last function parameter). Thanks to skyshard
for reporting the issue and the fix. (closes #19)
Version 0.5.0
-------------
Breaking Changes
* These Sag class functions now return the class's current instance ($this):
decode, setDatabase, setOpenTimeout, setRWTimeout, setCache,
setStaleDefault. This allows configuration functions to be chained before
you make a call to CouchDB. (closes #14)
* Sag->setDatabase() will now URL encode database names that are passed to
it. This may break your code if you were already encoding database names
before passing them. For example,
`$sag->setDatabase(urlencode('some/db'));` will no longer work as expected.
Instead use `$sag->setDatabase('some/db');`.
New Features
* Sag now supports connection pooling for sockets with HTTP's Connection:
Keep-Alive. This means Sag no longer opens and closes a socket for each
request made (better performance). No management is provided for the
maximum number of sockets that can be kept open, since this should be done
at the operating system level (ulimit or pam for Linux/Unix). (closes #15)
* Adding support for CouchDB 1.1.x, while dropping support for 0.11.x - most
of, or all of, 0.11.x will still work with Sag.
* Added the examples/ directory with an example of how one could store PHP
session data in CouchDB. Related blog post:
http://weblog.bocoup.com/storing-php-sessions-in-couchdb
* Added tests/bootstrap.php to make running the tests easier.
Fixed Bugs
* All functions that take query parameters as function parameters, such as
'startkey' in Sag->getAllDocs(), now URL encode those parameters before
adding them to the URL. However, functions that you pass whole URLs to,
like Sag->get(), do not deconstruct the URL for parameters - you must do
your own URL encoding when providing a full URL to a function.
* Sag->bulk() no longer attempts to cache. This is not a breaking change,
because it was never able to successfully cache before.
Version 0.4.0
-------------
New Features
* When initiated, Sag checks the PHP environment for unsupported
error_reporting values. Thanks to Simeon Willbanks. (closes #8, #9)
* setStaleDefault() was created to easily allow developers the choice of
making all of their GET and HEAD requests use stale=ok or not. This is
great for production systems that do all their querying against stale
views, allowing another process to trigger index updates based on the
_changes feed.
* Now when calling setDatabase() you can tell it to create the database if it
does not exist (uses an HTTP GET to check if it exists). If the database
does not exist, then createDatabase() is called to create it.
Fixed Bugs
* Fixed a bug where an invalid Content-Size was being sent even if no data
was passed to the packet.
* Fixed a bug in POST where an incorrect variable name was being used,
allowing improper paths to be sent to CouchDB.
* When caching, bulk() now iterates over the documents it's trying to update
and sends them to the cache. If a document's _deleted property is true,
then it's removed from the cache.
Version 0.3
-----------
New Features
* Cookie based authentication. Thanks to Benjamin Young. (closes #1)
* Cache results with the SagCache interface. Currently supports caching to
disk with SagFileCache.
* Support for HEAD requests. Thanks to Doug Cone. (closes #3)
* You can now POST to any URI in the database, adding a second $uri parameter
to the post() function. Allows POST'ing to views. Thanks to Peter Kruithof.
(closes #7)
* Exposing CouchDB's runtime _stats interface with the getStats() function.
Fixed Bugs
* getAllDocs() no longer always includes documents. Thanks to
www.github.com/hepp.
Version 0.2
-----------
* Officially adding support for 1.0.x and dropping support for 0.10.x.
New Features
* Native support for attachments.
* Internal support for different Content-Type values.
* Can set timeout on socket connection.
* Can set timeout on socket read/write.
Fixed Bugs
* Removed leading white space in header values.
* Fixed ending line breaks when sending data via a PUT.