Commit Graph

190 Commits

Author SHA1 Message Date
Daniel Hensby
8d1a5ed8b7
More code style fixes 2017-12-05 14:20:13 +00:00
Daniel Hensby
2aa1d8f2c4
remove create_function usage 2017-12-05 14:20:13 +00:00
Patrick Nelson
4bd66b9d36 FIX for #4909: Ensure RSSFeed_Entry is instantiated using the injector. 2016-05-11 14:35:24 -07:00
Damian Mooyman
3bc44d271e Merge pull request #4864 from robpetreski/patch-2
Updated RestfulService to include PATCH
2015-12-22 14:54:01 +13:00
Robert Petreski
110ee04244 Updated RestfulService to include PATCH
RestfulService now allows PATCH and also removed CURLOPT_POST
2015-12-22 09:14:19 +11:00
Ingo Schommer
4f55b6a115 [ss-2015-022]: XML escape RSSFeed $link parameter 2015-11-11 16:54:04 +13:00
Damian Mooyman
e14f743bf0 Set deprecation level for all changes in 3.x to 4.0 2015-06-19 13:07:41 +12:00
Loz Calver
c58f4c469d Replace core uses of DataObject::has_one/has_many/many_many 2015-03-13 16:16:12 +00:00
Damian Mooyman
dff65867cc Merge remote-tracking branch 'origin/3.1' into 3
Conflicts:
	control/HTTP.php
	control/HTTPResponse.php
	docs/en/05_Contributing/01_Code.md
	forms/CompositeField.php
	forms/FormAction.php
	forms/FormField.php
	forms/InlineFormAction.php
	forms/NumericField.php
	forms/TreeDropdownField.php
	forms/TreeMultiselectField.php
	templates/forms/TreeDropdownField.ss
	tests/core/CoreTest.php
	tests/forms/NumericFieldTest.php
	tests/model/DataDifferencerTest.php
2015-02-20 10:17:19 +13:00
Giovanni Derks
4bda7943a7 fixes #3850: RestfulService not using the cache 2015-02-04 16:58:42 +00:00
Damian Mooyman
0b1f297873 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	README.md
	admin/code/LeftAndMain.php
	admin/css/screen.css
	admin/scss/screen.scss
	api/RestfulService.php
	conf/ConfigureFromEnv.php
	control/injector/ServiceConfigurationLocator.php
	control/injector/SilverStripeServiceConfigurationLocator.php
	core/ClassInfo.php
	core/Object.php
	css/AssetUploadField.css
	css/ComplexTableField_popup.css
	dev/CSSContentParser.php
	dev/DevelopmentAdmin.php
	docs/en/changelogs/index.md
	docs/en/misc/contributing/code.md
	docs/en/reference/execution-pipeline.md
	filesystem/GD.php
	filesystem/ImagickBackend.php
	filesystem/Upload.php
	forms/Form.php
	forms/FormField.php
	forms/HtmlEditorConfig.php
	forms/gridfield/GridFieldDetailForm.php
	forms/gridfield/GridFieldSortableHeader.php
	lang/en.yml
	model/Aggregate.php
	model/DataList.php
	model/DataObject.php
	model/DataQuery.php
	model/Image.php
	model/MySQLDatabase.php
	model/SQLQuery.php
	model/fieldtypes/HTMLText.php
	model/fieldtypes/Text.php
	scss/AssetUploadField.scss
	search/filters/SearchFilter.php
	security/Authenticator.php
	security/LoginForm.php
	security/Member.php
	security/MemberAuthenticator.php
	security/MemberLoginForm.php
	security/Security.php
	tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php
	tests/control/HTTPTest.php
	tests/control/RequestHandlingTest.php
	tests/filesystem/UploadTest.php
	tests/forms/FormTest.php
	tests/forms/NumericFieldTest.php
	tests/model/DataListTest.php
	tests/model/DataObjectTest.php
	tests/model/TextTest.php
	tests/security/MemberAuthenticatorTest.php
	tests/security/SecurityDefaultAdminTest.php
	tests/view/SSViewerCacheBlockTest.php
	tests/view/SSViewerTest.php
2014-11-18 12:45:54 +13:00
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
Damian Mooyman
eb069e605d Remove all redundant whitespace 2014-08-19 09:17:15 +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
Daniel Hensby
87bb99667e Revert "FIX: allow CURLOPT_CONNECTTIMEOUT to be configured."
This reverts commit 0d493d4eff.
2014-05-06 22:13:56 +01: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