Commit Graph

176 Commits

Author SHA1 Message Date
Elvinas L.
64490129c2 RSS feed should be sent with charset=utf-8 header 2014-08-29 11:04:44 +03:00
Sean Harvey
2b316e79e5 NEW Provide a consistent way of triggering flush
Provides an interface for classes to implement their own flush()
functionality. This function gets called early in a request on
all implementations of Flushable when flush=1|all is requested in the
URL.

This fix came out of an issue where Requirements combined files were not
being cleaned up after dev/build?flush=1, due to the fact that flush
would only occur when you called it while on a page that used those
combined files, but not in any other contexts. This will now call flush
on any implementors of Flushable regardless of the context of where
flush was called.
2014-08-22 09:24:27 +12:00
Will Rossiter
0d493d4eff FIX: allow CURLOPT_CONNECTTIMEOUT to be configured. 2013-12-01 15:13:22 +13:00
Daniel Hensby
a1ad45486b FIX Changing public static $priority to private
Deprecation error thrown in master whilst this is public
2013-10-17 11:55:59 +01:00
Ju
e49d247fba fixed wrong ID output for many_many and has_many relations 2013-10-06 17:36:31 +02: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
Simon Welsh
151baeede1 Correct line length and indentation 2013-08-21 18:54:05 +12:00
Daniel Hensby
ddd6a15b4a FIX RestfulService header parsing now accepts non-title case headers 2013-07-10 13:00:40 +01:00
Ingo Schommer
3b02d22989 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	dev/CsvBulkLoader.php
2013-05-09 10:34:20 +02:00
Ingo Schommer
b211f22bf9 FIX JSONDataFormatter wrong relation identifiers (fixes #1795) 2013-04-26 11:40:24 +02:00
Ingo Schommer
1916a6e8f4 Fixed config API usage (unknown call to set()) 2013-03-26 00:04:01 +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
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
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
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +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