Commit Graph

53 Commits

Author SHA1 Message Date
Ingo Schommer
06ff9f72b1 Increased recent deprecation warnings from 3.1 to 3.2
The deprecations are supposed to denote the release where
the functionality will be removed, as opposed to the one where
its deprecated. Having 3.1 as a target for recent changes
in popular methods like Object::add_extension() causes
too many short-term hassles, there's no "grace period".
2013-03-20 10:00:51 +01:00
Ingo Schommer
e486574b31 Merge pull request #1203 from dhensby/restfulservice-improvements
BUG Fixing a couple of bugs in RestfulService
2013-03-12 15:54:52 -07:00
Sam Minnée
b90e0c0955 Merge pull request #1230 from oddnoc/3.1-restfulservice-error-check
BUG: Fetch curl_error in RestfulService
2013-02-24 17:59:32 -08:00
Fred Condo
d3b3ab806d BUG: Fetch curl_error in RestfulService
$curlError was used only once and never defined. Replace $curlError with
a call to curl_error($ch).
2013-02-22 17:41:55 -08:00
Fred Condo
bd73142bcf BUG: Correct semantic error regarding cURL options in RestfulService
cURL options are numeric, and array_merge is destructive of numeric
keys. Replace array_merge calls with array union operator, with defaults
on right-hand side so that passed options override defaults.
2013-02-22 17:39:01 -08:00
Daniel Hensby
1cf2259b2c BUG Undefined var
Getting the curl error.
2013-02-19 12:07:22 +00:00
Daniel Hensby
8d32ae954b BUG setBody on SS_HTTPRequest is a function
When settingt he cached body on the RESTfulService_Response, the setBody should be a function call, not a variable assignment
2013-02-18 11:55:11 +00:00
Daniel Hensby
920fd71a2f Adding default curl options
Because I removed completely the static setting of SSL_VERIFYPEER I've
added the ability to declare default curl options on the class. This
means that users that really want to one line turn off SSL_VERIFYPEER
can do so without needing to pass a custom option in every request()
call.
2013-02-15 11:45:52 +00:00
Daniel Hensby
f003359047 RestfulService_Response now gets response headers
Before now, the RestfulService_Response object was never sent the
response headers. For APIs that rely on the response headers to send
back information (signatures, pagination info, etc).

This change makes the curl response have the full HTTP response
(including Headers). We then extract the body and the header information
and assign them to relevant vars and then construct the response as
before (with the addition of the headers array).

This change required two new functions:
extractResponse: This extracts the HTTP Headers and the payload from the
curl response and assigns it to the relevany vars that are passed by
reference
parseRawHeaders: This was designed to mimic http_parse_headers (a
non-standard php class). It converts the headers into an associative
array.
2013-02-15 11:45:36 +00:00
Daniel Hensby
7c189731e3 Better cache key generation
All of the arguments supplied to the request function can impact what is
returned by a restful service.

This takes account of that and makes the cache key more specific,
including basic auth details, so we don't rely on *just* the absolute
URL for caching.
2013-02-15 11:16:46 +00:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Ingo Schommer
0e8c3acc35 MINOR Using SapphireInfo non-statically in RestfulService (fixes #7238) 2012-04-30 10:22:00 +02:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Fred Condo
d370423825 Clean up trailing ?> per coding standard
All sapphire but the lang directory
2012-02-12 12:40:16 -08:00
Fred Condo
9bd499617b Spelling correction
Found and fixed all misspellings of "[Hh]ierarchy"
2011-10-18 15:32:52 -07:00
ajshort
3f132a105b API CHANGE: Replaced DataObjectSet instances with ArrayList. 2011-05-05 20:40:24 +10:00
ajshort
eb1a3fe75a API CHANGE: Separated the actual CURL request generation code from RestfulService::request() into RestfulService::curlRequest().
MINOR: Updated RestfulServiceTest to use a mock service rather than the actual site. This eliminates the need for ?usetestmanifesst.
2011-03-24 21:31:00 +11:00
Sean Harvey
145d285d4b BUGFIX RestfulService CURLOPT_FOLLOWLOCATION cannot be used when open_basedir option enabled in PHP (thanks jshipman!)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115062 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-15 05:23:55 +00:00
Sam Minnee
7f3f167748 ENHANCEMENT: make RestfulService support PUT method. (from r108942)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112768 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 00:51:33 +00:00
Sam Minnee
d60ef78ba4 ENHANCEMENT: Restful service returns cached response on http and curl errors (from r108437)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112750 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 00:36:48 +00:00
Ingo Schommer
6460d09570 MINOR Fixed phpdoc documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@103385 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-23 00:11:41 +00:00
Ingo Schommer
f660634cc9 ENHANCEMENT you can now pass arbitrary CURL options to the request() method of RestfulService. (from r98656)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102770 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 02:20:57 +00:00
Ingo Schommer
028d59ffc3 ENHANCEMENT Added RestfulService::set_default_proxy() and RestfulService->setProxy() (#4637, thanks hamish) (from r97192)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102432 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 03:39:14 +00:00
Ingo Schommer
37685e6d3f API CHANGE Removed RestfulService->connect(), use RestfulService->request()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@91587 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-15 19:39:48 +00:00
Sam Minnee
4252067f0c MINOR Changed silverstripe.com references to silverstripe.org
MINOR Fixed broken wiki links (#4672) (from r90886)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90957 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-06 03:35:07 +00:00
Andrew Short
79773042be API CHANGE: Renamed conflicting classes to have an "SS_" namespace, and renamed existing "SS" namespace to "SS_". The affected classes are: HTTPRequest, HTTPResponse, Query, Database, SSBacktrace, SSCli, SSDatetime, SSDatetimeTest, SSLog, SSLogTest, SSLogEmailWriter, SSLogErrorEmailFormatter, SSLogErrorFileFormatter, SSLogFileWriter and SSZendLog.
MINOR: Replaced usage of renamed classes with the new namespaced name.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90075 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-26 03:06:31 +00:00
Sean Harvey
b77d088d47 Merged in parent::__construct() additions from branches/2.3 - r83580 and r83587
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86676 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-18 03:02:19 +00:00
Ingo Schommer
faed7b0c14 MINOR Making version number in RestfulService dynamic (see #4383)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81824 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-14 20:55:42 +00:00
Ingo Schommer
c1f0dda466 BUGFIX Deleted duplicate call to curl_exec() in RestfulService (merge error from r69704)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81822 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-14 20:51:58 +00:00
Sean Harvey
1b1809f1a2 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80873 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-02 07:18:18 +00:00
Andrew O'Neil
60f75c5ca4 Merged changes from 2.3 branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71172 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-01 23:49:53 +00:00
Ingo Schommer
085346f0e0 MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69704 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-05 06:19:48 +00:00
Sam Minnee
3d9532db83 Merged branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66108 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-18 01:48:37 +00:00
Sean Harvey
6195772779 ENHANCEMENT Allow use of RestfulService->setQueryString() and test to support it. Patch from ticket #2973. Thanks to simon_w!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64596 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-21 03:45:44 +00:00
Ingo Schommer
81e89c08fe API CHANGE Removed deprecated RestfulService->connect(), use RestfulService->request()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64373 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 08:34:45 +00:00
Ingo Schommer
2d8434a43f (merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60327 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-11 02:57:59 +00:00
Ingo Schommer
6bd5da7e6e (merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60206 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-09 03:29:30 +00:00
Sam Minnee
b3a098fe32 BUGFIX: [dio5] #2549 - Fixed bugs in RestfulService::connect()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@58796 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-07-23 04:09:16 +00:00
Ingo Schommer
60860cc1b9 MINOR Unified @package PHPdoc (added where missing, removed duplicates)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56212 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-06-15 13:33:53 +00:00
Sam Minnee
0b577aa401 Updated RestfulService.php with RestfulService::request()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51860 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-03-30 23:17:36 +00:00
Sam Minnee
9d025c213a BUGFIX Update RestfulService so that it still functions if Curl-SSL isn't set up properly
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51211 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-03-17 09:11:24 +00:00
Sam Minnee
9ec3e2fd6e Merged revisions 51203 via svnmerge from
http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.2

........
  r51203 | sminnee | 2008-03-17 21:07:01 +1300 (Mon, 17 Mar 2008) | 3 lines
  
  API CHANGE Added RestfulService::httpHeader() for setting custom headers on REST requests
  API CHANGE Added RestfulService::basicAuth() for setting authentication for REST requests
  API CHANGE Added  param to RestfulService::connect(), to allow for requesting of multiple URLs from a single RestfulService object.
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51210 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-03-17 08:25:07 +00:00
Matt Peel
7d13ba7fb8 Reverted geoffm's accidental commit to /open
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50107 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-02-25 02:10:37 +00:00
Geoff Munn
bf3c09bec6 First post
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50105 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-02-25 01:06:39 +00:00
Ingo Schommer
9a36047021 converted TODO into @todo for better PHPDocumentor support
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47884 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-01-11 01:49:50 +00:00
Sam Minnee
3936bc516b lperera: #1975 - Improvements to RestfulService
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47837 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-01-10 04:52:25 +00:00
Sam Minnee
b1d2e3906b API Documentation updates
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47766 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-01-09 04:18:36 +00:00
Sam Minnee
d27937f448 Updated API documentation package tags
Fixed some whitespace

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47725 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-01-08 06:37:50 +00:00