Commit Graph

163 Commits

Author SHA1 Message Date
Sam Minnee
50f36447a9 Merge branch '3.1' 2013-02-25 16:59:37 +13: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
Ingo Schommer
af96432c1e Merge remote-tracking branch 'origin/3.1'
Conflicts:
	api/RSSFeed.php
2013-02-18 14:18:54 +01:00
Ingo Schommer
6ff1f9050d Merge pull request #1187 from dhensby/restfulservice-improvements
API Restfulservice improvements
2013-02-15 10:45:43 -08: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
Ingo Schommer
14a56c18e9 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	control/Director.php
2013-02-07 21:45:16 +01:00
uniun
e249799e9a Incorrect Contant-Type header for RSS feeds
It should be application/rss+xml but not text/xml.
2013-02-05 18:11:28 +02:00
jonom
e8da9c9eb8 API: Use HTMLText as default for RSS Description
To allow for custom RSS descriptions (i.e. provided by a method rather than a DB field) and avoid double escaping a better default class for Description is 'HTMLText'. http://www.silverstripe.org/customising-the-cms/show/11606#post319519
2013-01-27 09:37:35 -07:00
Simon Welsh
d795b191ec Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:39:34 +13:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Simon Welsh
379b561cdb BUG RSSFeed now sets the Content-Type on the current HTTPResponse
RSSFeed::outputToBrowser() used to use header() directly to set the content-type.
This stopped ContentNegotiator from correctly detecting that it didn't need to
convert the response, invalidating the XML.
2012-12-12 10:38:56 +13:00
Simon Welsh
fc5dd2994c Add codesniffer that ensures indentation is with tabs. 2012-12-12 00:12:11 +13:00
Sean Harvey
fbc6e3366b Merge branch '3.0' 2012-11-05 15:11:48 +13:00
Sean Harvey
aff28eb896 BUG JSONDataFormatter should respect canView() permissions 2012-11-05 14:03:39 +13:00
Ingo Schommer
d54b1b4d86 API Removed permission checks from XML/JSON data formatters
Please handle those checks in the logic using the formatters
instead. Applied permission checks to its primary use case,
the "restfulserver" module.
2012-10-30 23:34:29 +01: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
Elliot Sawyer
71758c782f ISSUE 7833: Invoke ShortcodeParser on RestfulServer output 2012-09-17 17:53:51 +12:00
Will Rossiter
7558d32da6 FIX: use standard template rendering process for RSS feeds
This changes the behaviour of output to browser to use the standard SilverStripe rendering process rather than an echo statement to enable easier testability.
2012-07-31 20:38:41 +12:00
Mateusz Uzdowski
34fdad8d50 Minor typo in RSS feed. 2012-07-20 09:08:40 +12:00
Will Rossiter
f1db65d6b6 API: add api for setting a custom template on a RSS feed.
See initial idea at http://open.silverstripe.org/ticket/6441. Added $template property and corresponding getters / setters for customizing the template used. Added relevant unit test.
2012-07-01 21:27:50 +12:00
Ingo Schommer
9e21fb8a4a API CHANGE Moved SapphireSoapServer and SOAPModelAccess into its own module at https://github.com/silverstripe/silverstripe-soapserver (fixes #7282) 2012-06-04 10:22:48 +02:00
Ingo Schommer
cb8b11812c API CHANGE Moved RestfulServer into its own module at https://github.com/silverstripe/silverstripe-restfulserver (fixes #7282) 2012-06-04 10:21:29 +02:00
Sean Harvey
6f672e5f36 MINOR Fixing use of <% control %> with <% with %> or <% loop %> as necessary. 2012-05-11 13:49:20 +12:00
Sean Harvey
0882741f54 API CHANGE Renamed setModel for DataModel instances to setDataModel for
semantics, and also to allow a field name called "Model"
2012-05-01 14:45:44 +12:00
Ingo Schommer
0e8c3acc35 MINOR Using SapphireInfo non-statically in RestfulService (fixes #7238) 2012-04-30 10:22:00 +02:00
Andrew O'Neil
fb3b03f38b MINOR: Remove support for PHP <5.3.2 2012-04-18 11:01:03 +12:00
Mateusz Uzdowski
59663f9289 BUGFIX: fix up some E_STRICT errors 2012-04-17 11:51:55 +12:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Simon Welsh
3a6341a251 API-CHANGE sapphire folder can now be renamed. 2012-04-15 10:50:19 +12:00
Simon Welsh
f8082e4814 MINOR Add newline to end of files without one 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
Stig Lindqvist
e22eaec204 BUGFIX Restfulserver should use the correct way when sorting SS_Lists 2011-12-17 16:42:30 +13:00
Ingo Schommer
d30b4b1d00 BUGFIX Respecting api_access on has_one relations in RestfulServer
BUGFIX Limiting fields according to api_access on relation object (rather than the "root" object) in RestfulServer
BUGFIX Limit listing of has_one relations in RestfulServer to actual relation (was listing all objects before)
BUGFIX Creating correct object instances in RestfulServer->getHandler() for relation queries
2011-11-13 14:09:44 +01:00
Ingo Schommer
ec47cc1286 MINOR Whitespace 2011-11-13 13:52:07 +01:00
Stig Lindqvist
e38dd08ea5 MINOR: Fix docblocks to reference SS_List instead of (now deprecated) DataObjectSet where appropriate 2011-10-28 15:58:55 +13:00
Fred Condo
9bd499617b Spelling correction
Found and fixed all misspellings of "[Hh]ierarchy"
2011-10-18 15:32:52 -07:00
Will Rossiter
1732a17114 Merged new-orm into datagrid 2011-09-26 16:47:54 +13:00
nicolaas
7b56008414 BUGFIX error in RestfulServer: currentMember should be currentUser (fixes #6283)
http://open.silverstripe.org/ticket/6283
2011-09-18 23:22:13 +02:00
Ingo Schommer
ce8e72cf0e MINOR Removing executable flag from all files (thanks miiihi) 2011-09-18 22:04:02 +02:00
ajshort
3f132a105b API CHANGE: Replaced DataObjectSet instances with ArrayList. 2011-05-05 20:40:24 +10:00
ajshort
43c39bed8f MINOR: Updated RestfulServer to properly convert list instances. 2011-05-03 13:11:09 +10:00
ajshort
04e5dae22e MINOR: Updated places that expect a DataObjectSet to accept an SS_List instance. 2011-05-02 17:14:05 +10:00
Sam Minnee
7fbb919ce8 API CHANGE: Introduce DataModel object, as a representation of the project's entire data model, and tie it to $this->model an all DataObjects, Controllers, and RequestHandlers for easy non-static access.
API CHANGE: Add DataList::newObject(), which creates a new object on that DataList.
API CHANGE: RequestHandler::handleRequest() now needs to handle a $model argument, if you override it.
2011-05-01 17:33:02 +12:00
Sam Minnee
b8f736d665 ENHANCEMENT: Updated restfulserver to make use of refactored searchquery. note that searchquery will probably be bypasssed entirely in the near future. 2011-05-01 15:25:58 +12:00
ajshort
3a1c2df4e7 API CHANGE: Renamed DataObjectDecorator to DataExtension.
API CHANGE: Renamed LeftAndMainDecorator to LeftAndMainExtension.
MINOR: Replaced all references to decorators with extension.
2011-04-26 11:01:38 +10:00