Commit Graph

1011 Commits

Author SHA1 Message Date
Damian Mooyman
6baf63e18c Merge remote-tracking branch 'origin/3.1'
Conflicts:
	dev/install/install.php5
	docs/en/changelogs/index.md
	security/Security.php
2014-11-19 11:16:46 +13: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
Ingo Schommer
5babab81ee Improve .htaccess commenting
Done alongside improvements of the execution-pipeline.md docs.
Installer comment taken from d5723f7.
2014-11-15 14:41:50 +13:00
Damian Mooyman
1e612607aa Suggested improvements / test case fixes 2014-10-10 09:28:11 +13:00
Daniel Hensby
3b9056fc01 NEW Cookie_Backend for managing cookie state
I've decoupled `Cookie` from the actual act of setting and getting
cookies. Currently there are a few limitations to how Cookie works that
this change mitigates:

0. `Cookie` currently changes the super global `$_COOKIE` when setting
to make the state of an application a bit more managable, but this is
bad because we shouldn't be modifying super globals
0. One can't actually change the `$cookie_class` once the
`Cookie::$inst` has been instantiated
0. One can't test cookies as there is no class that holds the state of
the cookies (it's just held in the super global which is reset as part
of `Director::test()`
0. One can't tell the origin of a cookie (eg: did the application set it
and it needs to be sent, or did we receive it from the browser?)
0. `time()` was used, so testing was made difficult
0. There was no way to get all the cookies at once (without accessing
the super global)

Todos are on the phpdoc and I'd like to write some tests for the backend
as well as update the docs (if there are any) around cookies.
DOCS Adding `Cookie` docs

Explains basic usage of `Cookie` as well as how the `Cookie_Backend`
controls the setting and getting of cookies and manages state of sent vs
received cookies
Fixing `Cookie` usage

`Cookie` is being used inconsistently with the API throughout framework.
Either by not using `force_expiry` to expire cookies or setting them to
null and then expiring them (which is redundant).
NEW `Director::test()` takes `Cookie_Backend` rather than `array` for `$cookies` param
2014-10-06 17:44:51 +13:00
Sean Harvey
ee717c7f66 Merge pull request #3287 from IgorNadj/3.1
ENH making /dev extendable
2014-09-25 18:34:21 +12:00
Mark Guinn
2fd3231325 Fixes a bug that ignored any overridden path for assets/error-404.html etc 2014-09-12 12:23:20 +01:00
AntonyThorpe
2d0fe7a4aa Update PhpUnitWrapper.php & TestRunner.php to recommend PHPUnit installation via Composer rather than PEAR
Using the PEAR Installer to install PHPUnit is no longer supported.  See https://github.com/sebastianbergmann/phpunit/wiki/End-of-Life-for-PEAR-Installation-Method.

Replace PEAR in a comment and die output message with Composer.

Signed-off-by: AntonyThorpe <antony.thorpe@budget12.com>
2014-09-08 17:46:09 +12:00
Sean Harvey
fe42abce69 BUG CSSContentParser fails if CLI tidy doesn't output anything.
In cases where CLI tidy fails to recognise HTML with errors or
unknown HTML5 elements, it doesn't output any content and
CSSContentParser fails.

This adds the --force-output parameter so that it always outputs
the input content, even if it wasn't completely fixed by tidy.

It seems that tidy class in PHP already does this, so this just
fixes the CLI use of tidy in CSSContentParser to be consistent.

This fix can be observed on the HHVM travis builds, as tidy isn't
compiled into HHVM as an extension.
2014-09-03 23:08:53 +12:00
Sean Harvey
0e07f1a7f5 Merge remote-tracking branch 'origin/3.0' into 3.1 2014-08-22 17:50:36 +12:00
Sean Harvey
8063b349c8 BUG Fixing Director::test() failing on BASE_URL prefixed URLs
Example: you have a site in a sub-directory off the webroot, you call
->Link() on a SiteTree record, which returns "/[sitedir]/my-page", and
you pass this URL to Director::test(). It's a valid URL, but
Director::test() will throw a 404.

Director::test() should be ensuring that all URLs passed to it are
properly made relative, not just in the case where it thinks the URL
is absolute.
2014-08-22 15:21:53 +12:00
Joel Marcey
0c85680371 Support PHPUnit 3.8+ compatibility
Summary:

PHPUnit 3.8+ adds a method to its PHPUnit_Framework_TestListener called addRiskyTest(). Need to stub it out to avoid "must implement this interface method" fatals when using 3.8+

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
2014-08-22 13:43:23 +12:00
Damian Mooyman
aec8430395 Merge pull request #3393 from halkyon/flushable
NEW Provide a consistent way of triggering flush
2014-08-22 10:28:26 +12: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
Simon Welsh
c4ea64e743 Merge pull request #3416 from halkyon/tidy_doc
CSSContentParser: Fix mispelled "tidy" and correct case of "tidy" class
2014-08-21 12:49:50 +10:00
Sean Harvey
fcdcc3889a CSSContentParser: Fix mispelled "tidy" and correct case of "tidy" class 2014-08-21 13:56:05 +12:00
Loz Calver
8e060d159f Fix: Make CSSContentParser's use of 'Tidy' consistent 2014-08-20 09:08:03 +01:00
Damian Mooyman
eb069e605d Remove all redundant whitespace 2014-08-19 09:17:15 +12:00
Sean Harvey
404478b07f Removing @deprecated 3.1 functionality and classes.
Changelog has been updated to include what was removed in terms of
major functionality, and what to use as a replacement.
2014-08-18 16:00:13 +12:00
Sean Harvey
8cf99b9bec Fixing inconsistent use of RewriteRule in docs and install.php5
It currently doesn't match the .htaccess that comes with a checkout of
silverstripe-installer.
2014-08-18 10:55:47 +12:00
Sean Harvey
672e817439 Merge pull request #3394 from simonwelsh/stupid-htaccess
Don't block rewriting .php URLs
2014-08-18 10:54:10 +12:00
Simon Welsh
b9ae401772 Don't block rewriting .php URLs 2014-08-16 22:08:52 +10:00
Damian Mooyman
7c2eee116f BUG Fix 'undefined index 0' 2014-08-14 12:24:56 +12:00
Mateusz Uzdowski
8bf3853887 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	docs/en/misc/contributing/issues.md
	docs/en/reference/uploadfield.md
	forms/HtmlEditorField.php
	i18n/i18n.php
	javascript/HtmlEditorField.js
	model/DB.php
	model/Image.php
	model/SQLQuery.php
2014-08-14 09:08:26 +12:00
Kirk Mayo
62f4fdb651 NEW: Sanitise task name in runTask 2014-08-13 17:29:12 +12:00
Simon Welsh
61395b5618 Merge pull request #3238 from mparkhill/3.1
FIX declarations matching PHPUnit_Framework_Assert
2014-08-07 21:30:04 +10:00
Simon Welsh
a0a2aac6df Merge pull request #3094 from dhensby/patch-3
Use Config nesting in `SapphireTest::useTestTheme()`
2014-08-07 20:50:16 +10:00
Igor Nadj
b3d52de531 ENH making /dev extendable 2014-08-06 16:29:52 +12:00
Damian Mooyman
08c58844ac PHPDoc cleanup 2014-07-29 12:43:43 +12:00
Damian Mooyman
0433ba1642 BUG Revert some changes to ManyManyList
BUG Fix incompatibility in Member_GroupList
Fix regressions in merges from 3.1
BUG Fix Security failing on test classes
BUG Fix postgresql compatibility
Clarify sql encoding of table names
2014-07-23 12:38:41 +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
Simon Welsh
cc9603d6a2 Fatal errors should always return false
This allows PHP to set the exit code on fatals.
2014-07-16 21:03:55 +10:00
Sean Harvey
3c0967efc0 Fixing function that should be declared as static. 2014-07-11 15:23:44 +12:00
Damian Mooyman
d8e9af8af8 API New Database abstraction layer. Ticket #7429
Database abstraction broken up into controller, connector, query builder, and schema manager, each independently configurable via YAML / Injector
Creation of new DBQueryGenerator for database specific generation of SQL
Support for parameterised queries, move of code base to use these over escaped conditions
Refactor of SQLQuery into separate query classes for each of INSERT UPDATE DELETE and SELECT
Support for PDO
Installation process upgraded to use new ORM
SS_DatabaseException created to handle database errors, maintaining details of raw sql and parameter details for user code designed interested in that data.
Renamed DB static methods to conform correctly to naming conventions (e.g. DB::getConn -> DB::get_conn)
3.2 upgrade docs
Performance Optimisation and simplification of code to use more concise API
API Ability for database adapters to register extensions to ConfigureFromEnv.php
2014-07-09 18:04:05 +12:00
Damian Mooyman
3c5e51a9f1 API Debug::dump in CLI no longer generates HTML. Uses colours.
API Column size is configurable in DebugView
2014-07-05 14:37:06 +12:00
Michael Parkhill
19e0d5e3d5 FIX declarations matching PHPUnit_Framework_Assert
FIX for phpunit error message: ERROR [Strict Notice]: Declaration of SapphireTest::assertNotContains() should be compatible with PHPUnit_Framework_Assert::assertNotContains, and the same error for assertContains()
2014-06-27 16:05:40 +12:00
Damian Mooyman
6ff1d3ccbc Merge pull request #3225 from halkyon/log_constants
Adding some more commonly used SS_Log priority constants.
2014-06-23 13:15:45 +12:00
Sean Harvey
9c2ddd4850 Adding some more commonly used SS_Log priority constants. 2014-06-23 11:50:05 +12: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
Hamish Friedlander
a263bed937 Merge pull request #3091 from willmorgan/pulls/testrunner-suites
TestRunner: allow test suite running
2014-05-22 10:32:21 +12:00
Damian Mooyman
ec578e5c8a Merge remote-tracking branch 'origin/3.1' 2014-05-12 11:32:22 +12:00
Will Morgan
8335de49b3 FIX remove redundant DB name switch in TestRunner
From what I can see, this doesn't actually do anything, except cause an error with cookie setting after HTTP body is sent when tests fail.
2014-05-09 10:15:53 +01:00
Will Morgan
d01cbbbdc7 TestRunner: allow test suite running 2014-05-09 10:03:59 +01:00
Damian Mooyman
9bfeffd06a Path resolution cleanup
Backport of #3085 to 3.0
2014-05-06 15:20:57 +12:00
Damian Mooyman
e9c3ff933f Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	composer.json
2014-05-06 10:22:09 +12:00
Damian Mooyman
d9bc352271 Path resolution cleanup
[ref: CWPBUG-158]
2014-05-05 14:52:41 +12:00
Simon Welsh
9116e40eb8 Don't add the class manifest with tests as an exclusive manifest 2014-05-04 11:46:06 +10:00
Daniel Hensby
5298371282 Use Config nesting in SapphireTest::useTestTheme()
Using the Config nesting functionality to restore variables
2014-05-02 15:25:31 +01:00
Damian Mooyman
b9872c0856 Allow PHPUnit installations with composer
Instruct travis to use composer version of phpunit
2014-05-02 18:23:58 +12:00
Will Morgan
bec8927a08 BUG Allow PHPUnit installation with composer / Fix travis 2014-05-02 18:22:04 +12:00