Commit Graph

34 Commits

Author SHA1 Message Date
Stevie Mayhew
1b57e0ca5b FEATURE: implement getter and setter usage for response 2015-08-29 10:24:06 +12:00
Stevie Mayhew
0d94cf15a5 UPDATE: change all instances of $this->request to use appropriate getter/setter 2015-04-30 11:04:08 +12:00
Damian Mooyman
eb069e605d Remove all redundant whitespace 2014-08-19 09:17:15 +12:00
Simon Welsh
c14d58f585 Merge branch '3.1'
Conflicts:
	.travis.yml
	model/ManyManyList.php
	model/fieldtypes/DBField.php
2014-07-16 21:24:02 +10:00
Sean Harvey
0ee3a683a5 Better support for overloading start and destroy methods in Session
Move functionality from static start and destroy functions into instance
methods, allowing these to be overloaded. This works the same way as
calling Session::set() which then in turn calls inst_set()

Additionally use Injector to create the default Session instance to
allow the class to be swapped out.
2014-06-20 10:35:53 +12:00
Daniel Hensby
7617f08ad3 Use Controller::join_links() in RestfulService
At the moment, `RestfulService` duplicates functionality of
`Controller::join_links` (badly) and it means that one MUST use a base
URL with a trailing slash for the URL to be constructed properly

Plus tests for `RestfulService::getAbsoluteRequestURL()`

API Deprecating `RestfulService::constructURL()`

This function isn't used in core so we should remove it
2014-05-08 08:59:57 +01:00
Hamish Friedlander
b1f03db4ff FIX Improve recent RestfulService fix for proxies 2013-09-20 16:26:39 +12:00
Mateusz Uzdowski
7ddd5b57c3 BUG Do not rely on broken curl header size calculation.
Header parsing now takes into account situations like a proxy or
redirections. Works around the curl issue.

Also fixes the issue when a redirected request would cause a double
amount of headers coming out of the parser - it would merrily process
anything that's in key:value format even if it was two distinct headers.
2013-09-20 15:02:40 +12:00
Daniel Hensby
378d829e8f Adding test to prove issue with HTTP Header parsing in RestfulService
I have a header like:
X-BB-Auth: xxxx

and it is being given back to me as X-Bb-Auth - i want to prove the issue and the fix
2013-07-10 12:47:13 +01:00
Ingo Schommer
3334eafcb1 API Marked statics private, use Config API instead (#8317)
See "Static configuration properties are now immutable, you must use Config API." in the 3.1 change log for details.
2013-03-24 17:20:53 +01: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
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Will Rossiter
4977318f46 FIX: ensure RestfulServiceTest uses email as the unique identifer field for running tests. Fixes: #6156. 2012-06-29 20:45:57 +12:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Simon Welsh
1eab669f9b Fucntion signatures should match when containing arrays (PHP5.4 bug) 2011-10-29 12:07:58 +13:00
Ingo Schommer
1a598fe39e MINOR Removed obsolete 'usetestmanifest' flag from documentation and RestfulServiceTest 2011-03-28 08:14:03 +13: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
Carlos Barberis
184e8bd852 ENHANCEMENT: Added allowed actions to core classes 2011-02-14 11:14:51 +13:00
Will Rossiter
0b54ce3450 ENHANCEMENT: #5248 improved the handling of attaching invalid extensions to dataobjects.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115174 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-19 23:04:44 +00:00
Sam Minnee
29ca5ff9a7 BUGFIX: disable basic auth for the restful controller test (from r109714)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112829 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 01:26:09 +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
Sean Harvey
c640c5c5a9 MINOR Removed calls to ContentNegotiator::disable() since it's disabled by default (from r93682)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93769 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-27 01:46:16 +00:00
Sam Minnee
0bb067eddf BUGFIX: Made use of new BasicAuth::protect_entire_site() consistent.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@91658 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-15 23:43:30 +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
Ingo Schommer
da1f065cf7 BUGFIX Removing quotes from test data in RestfulServiceTest, it gives different results depending on magic_quotes_gpc setting on PHP configuration
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80132 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-26 03:14:22 +00:00
Ingo Schommer
6b90c02940 ENHANCEMENT Refactored RestfulServiceTest to use a mocked RestfulService with Director::test() instead of curl calls. Simplified test cases.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79927 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-24 03:05:33 +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
e7e8a1209b BUGFIX #3376 RestfulServiceTest fails with "authorization required" - seems to happen if result cache is not invalidated properly, hence made sure to call ?flush=1 on each URL
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70665 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-23 02:08:01 +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
c1d6e82248 API CHANGE: Removed manifest's dependency on database, by removing hastable information [17:47:04]
dquote> API CHANGE: Deprecate ClassInfo::ready() in favour of Security::database_is_ready()
dquote> API CHANGE: Create DataObject::has_own_table() to determine whether a DataObject has a table without looking at it.
dquote> API CHANGE: Exclude /tests/ directories from the manifest entirely except when tests are being run.
dquote> API CHANGE: Added ?usetestmanifest=1 flag to access the test manifest outside of test execution.
dquote> API CHANGE: Simplified Core.php manifest include to just call ManifestBuilder::include_manifest() - manifest takes care of its own cache file

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65385 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 04:51:25 +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