Commit Graph

2853 Commits

Author SHA1 Message Date
Ingo Schommer
b53790eace Fluent API for PaginatedList 2012-08-28 17:28:37 +02:00
Sam Minnée
93cdb83ac8 Merge pull request #738 from simonwelsh/lsb-53-30
FIX Removes version checking for LSB in Object::static_lookup()
2012-08-27 21:07:29 -07:00
Hamish Friedlander
26cfd64d8e FIX issue with cyclic configs when framework called sapphire
The _config/route rules explicitly mentioned framework by module name,
so if you installed framework in the older sapphire directory youd
always end up with cyclic config requirement errors
2012-08-28 15:44:40 +12:00
Hamish Friedlander
aa0cd147bf FIX Make config DAG error message more dev friendly 2012-08-28 14:38:33 +12:00
Sam Minnée
dd97da0ac2 Merge pull request #741 from silverstripe-rebelalliance/trac/7765
FIX several issues with the config system
2012-08-26 22:18:14 -07:00
Hamish Friedlander
6009cfadc2 NEW Allow debugging of config cyclic errors
It is possible to specify before and after rules on config fragments
that conflict - A before B and B before A isnt possible to solve.

This used to just throw an error with no way to debug. Now if you
specify debug as a GET parameter and the site is not in live mode
youll get a basic dump of the remaining DAG graph
2012-08-27 16:08:10 +12:00
Hamish Friedlander
e0b8f15171 FIX Config wasnt filtering wildcards properly
When specifying a specific before rule and a wildcard after rule (or
vice versa), the config system was filtering out any fragment
from the list of fragments that matched the wildcard if it matched
_any_ componenet of the specific rule, not all of them.

Fixed, and added handling of two semi wild-card rules, where a
rule with less wildcards wins over a rule with more.

See http://open.silverstripe.org/ticket/7765 for more
2012-08-27 16:03:03 +12:00
Hamish Friedlander
c7ca47f2b1 FIX Config frag could only have one before or after rule
You should be able to specify multiple before and after rules in
a config fragment. This was intended to be a comma seperated string
but that wasnt being split properly

Now if you provide a comma seperated string it is split properly,
but you can also provide an array, which is actually cleaner
2012-08-27 16:00:54 +12:00
Simon Welsh
e159a68f89 FIX Removes version checking for LSB in Object::static_lookup()
Late static binding was added in PHP 5.3, not 5.4. As such, the check for 5.4
and then fallback to Reflection isn't needed.
2012-08-23 17:51:29 +12:00
Hamish Friedlander
fa37c448a5 API Reverse config extra statics control flow
Config system used to provide an add_static_source method, which was intended for
use by Extensions to add statics. But extensions for a class arent initialised
until at least one instance of that class is created, so before that the
Config system didnt include values from extensions

This patch reverses the control flow, so that the Config system explictly asks
each Object for its additional config sources via the new method
get_extra_config_sources. This method returns an array that can contain
string names of classes and also raw associative arrays.

The developer visible change is that Extension#add_to_class has been
deprecated. Instead there is a new method, get_extra_config, which has
the same method signature but needs to guarantee that it doesnt
cause side effects. Additionally there is no need to call
parent::get_extra_config - this is handled automatically.
2012-08-23 09:29:13 +12:00
Saophalkun Ponlu
c555256890 BUGFIX: PaginatedList::getIterator() trims the original list to the page lenght when the source list is DataList 2012-07-15 01:02:49 +12:00
Ingo Schommer
712f28bc78 Scoped deprecation messages (fixes #7645) 2012-07-13 11:37:35 +02:00
Ingo Schommer
64357a4522 Merge branch '3.0'
Conflicts:
	admin/css/screen.css
	admin/scss/_forms.scss
	docs/en/changelogs/3.0.0.md
2012-07-05 18:01:09 +02:00
Sam Minnee
6ef4f9ad3f BUG: Fix increase_memory_limit_to() to reduce installation errors.
increase_memory_limit_to() was broken a while ago, and this causes a lot of problems for people trying to install on environments where the memory limit is 32M.
2012-06-26 12:39:50 +12:00
Andrew Short
77d712202c ENHANCEMENT: Add method to disable automatic limiting on PaginagedLists.
In some circumstances a custom generated list will already only contain
the items for the current page. The automatic limiting will then limit
the already limited list, breaking pagination. This allows you to disable
automatic limiting so all items are shown regardless of the current page.
2012-06-21 21:21:34 +02:00
Ingo Schommer
45a14951a3 Revert "MINOR Updated sfYaml parser dependency to 2.0.14, use it in ConfigManifest and i18nTextCollector"
This reverts commit 3a01c2ab2e.

Conflicts:

	core/manifest/ConfigManifest.php
	i18n/i18nTextCollector.php
2012-06-21 21:11:48 +02:00
Ingo Schommer
51a1026cd8 MINOR Fixed case sensitive require_once() (broken by 3a01c2ab2) 2012-06-20 14:41:40 +02:00
Ingo Schommer
3a01c2ab2e MINOR Updated sfYaml parser dependency to 2.0.14, use it in ConfigManifest and i18nTextCollector
Changed class loading to new file structure, moved dependency to framework/thirdparty,
rather than relying on "second level" dependencies through Zend_Translate_RailsYAML.
To be replaced by a composer dependency (+ proper autoloading) once in place.
2012-06-20 14:06:21 +02:00
Sam Minnée
5062bb8ff5 Merge pull request #533 from halkyon/supress_mkdir_temp
BUGFIX Supress mkdir() when attempting to create a temp folder, instead
2012-06-14 16:53:54 -07:00
Sean Harvey
105986392b BUGFIX Supress mkdir() when attempting to create a temp folder, instead
of the variable. This gives a nicer error in the installer.
2012-06-15 11:48:42 +12:00
Marcus Nyeholt
77099ddf9d BUGFIX Moved initialisation of injector to the start of Core.php to make sure that it is initialised correctly before additional code blocks reference it (in particular some of the code introduced by Sam that is triggered during add_extension). 2012-06-14 20:28:20 +10:00
Sam Minnee
114ebb6953 API CHANGE: Don't have any instance caching in singleton(), rely on Injector for this. 2012-06-11 22:41:12 +12:00
Sam Minnee
f65a7c6b21 API CHANGE: Remove dodgy DataObject::destroy() behaviour, opting instead for using PHP5.3's garbage collector. 2012-06-11 22:41:12 +12:00
Sam Minnée
f8921f7c9f Merge pull request #500 from nyeholt/injector_strong_create
RECOMMIT This is a recommit of a previously merged, but reverted, commit...
2012-06-04 15:32:19 -07:00
Marcus Nyeholt
82a1e7d282 MINOR Use injector for creating Member_GroupSet object
MINOR Use injector for creating many many list objects

MINOR Use injector for creating objects from within the DataList

MINOR Use Injector::inst() for creating objects; cannot rely on this->injector being present due to many classes being created with 'new', so use inst() directly

MINOR Remove injector autoset property for now; automatically setting it breaks a few test cases that don't know about it for now, and it's not needed just yet
2012-06-05 01:33:44 +10:00
Marcus Nyeholt
ae7fc6f4d2 RECOMMIT This is a recommit of a previously merged, but reverted, commit. The initial commit had problems when running "tests/all flush=all" when dev/build would re-analyse a bunch of stuff; fixes to address this went into https://github.com/silverstripe/sapphire/pull/487, but for some reason the actual base changes didn't, so I'm re-submitting them in a separate pull.
BUGFIX Versioned's constructor doesn't provide suitable defaults. Previously a bug/feature in singleton, where it would pass null,true as params to strong_create, which would then get passed through as params to Versioned's constructor, meant that the code still executed fine (as was set to something that wasn't an array, so the null and true were instead taken as args). The fact that the usage of singleton(Versioned) never really used the classes code, purely for value lookup, meant that this never propagated errors. I've now switched singleton() to use the injector for retrieving values, which means these dud values are no longer passed through

CHANGE Given that Config::inst is an implementation of the singleton pattern itself, I've removed the extra call to singleton(). A side effect of this is that it gets around a possibly nasty circular reference with the dependency injector (which relies on the config object); in future, this dependency structure should really be structured from the DI directly.

MINOR Change singleton and strong_create to use dependency injector
2012-06-03 20:41:00 +10:00
Sean Harvey
c3eabffcb9 MINOR Use shorthand {class}::get() syntax instead of DataList::create()
in core code.
2012-05-28 21:13:42 +12:00
Sean Harvey
29e04a1049 Revert "BUGFIX Versioned's constructor doesn't provide suitable defaults. Previously a bug/feature in singleton, where it would pass null,true as params to strong_create, which would then get passed through as params to Versioned's constructor, meant that the code still executed fine (as was set to something that wasn't an array, so the null and true were instead taken as args). The fact that the usage of singleton(Versioned) never really used the classes code, purely for value lookup, meant that this never propagated errors. I've now switched singleton() to use the injector for retrieving values, which means these dud values are no longer passed through"
This reverts commit 5eaca340b4.
2012-05-23 09:52:57 +12:00
Marcus Nyeholt
5eaca340b4 BUGFIX Versioned's constructor doesn't provide suitable defaults. Previously a bug/feature in singleton, where it would pass null,true as params to strong_create, which would then get passed through as params to Versioned's constructor, meant that the code still executed fine (as was set to something that wasn't an array, so the null and true were instead taken as args). The fact that the usage of singleton(Versioned) never really used the classes code, purely for value lookup, meant that this never propagated errors. I've now switched singleton() to use the injector for retrieving values, which means these dud values are no longer passed through
CHANGE Given that Config::inst is an implementation of the singleton pattern itself, I've removed the extra call to singleton(). A side effect of this is that it gets around a possibly nasty circular reference with the dependency injector (which relies on the config object); in future, this dependency structure should really be structured from the DI directly.

MINOR Change singleton and strong_create to use dependency injector
2012-05-22 19:09:35 +10:00
Hamish Friedlander
18ddae3375 BUGFIX: Make config yaml fragments merge following the same rules as other config sources 2012-05-19 14:37:32 +12:00
Sam Minnee
1e47b0fbd3 BUGFIX: Don't include ._-prefixed config files. 2012-05-18 16:15:14 +12:00
Marcus Nyeholt
b269badfbe FEATURE: Added dependency injector for managing creation of new objects and their dependencies.
API CHANGE: Pass Object::create() calls to Injector::create().
API CHANGE: Add "RequestProcessor" injection point in Director, that Director will call preRequest() and postRequest() on.
2012-05-18 12:39:57 +12:00
Sean Harvey
6f672e5f36 MINOR Fixing use of <% control %> with <% with %> or <% loop %> as necessary. 2012-05-11 13:49:20 +12:00
Ingo Schommer
1671b9c65c BUGFIX Checking for mbstring PHP extension support in installer, as it has been a documented installation requirement for a while. Removing method_exists() checks from mbstring usage in core for the same reasons 2012-05-09 10:25:31 +02:00
Sean Harvey
051d9de482 API CHANGE Deprecated internal access to SQLQuery properties, update core code to reflect these changes.
Using set/add instead in accessor methods, and use Database::sql*ToString() to allow easier per-database adapter SQL overloading.
2012-05-07 14:21:44 +12:00
Sean Harvey
5702007da1 MINOR Fixing comment to be more concise. 2012-05-04 11:11:36 +12:00
Ingo Schommer
20a837947f MINOR Using PHP version constants rather than version_compare() in Object::static_lookup(), since its called 10k times on an average CMS load that makes a difference of about 3% (with APC) 2012-05-04 00:26:09 +02:00
Ingo Schommer
431b9589b6 BUGFIX Fixed arguments in global _t() function, added check for $returnValue fallback that its not the injection array as second parameter 2012-05-01 22:17:01 +02:00
Julian Seidenberg
523c19e88a BUGFIX: fixing core error that occurs when there are two or more proxy servers in front of the SilverStripe application server 2012-04-27 11:03:05 +02:00
Julian Seidenberg
e486ec41e0 MINOR: updating documentation to use "Simple" theme 2012-04-24 15:57:27 +12:00
Will Rossiter
585417d141 Merge pull request #343 from halkyon/object_static_remove_deprecation
BUGFIX Remove calls to deprecated Object static methods, update ConfigTest
2012-04-19 14:41:45 -07:00
Sean Harvey
4cf8db3ee4 ENHANCEMENT Remove use of deprecated extraStatics in core files 2012-04-19 08:37:51 +12:00
Sean Harvey
4c6be2931b BUGFIX Removing use of deprecated Object static functions like
get_static(), set_static(), uninherited() etc. Replace with equivalent
Config system get(), update()
2012-04-18 23:10:57 +12:00
Andrew O'Neil
14c0796617 MINOR: Remove checks for PHP < 5.3.2, as it's no longer supported 2012-04-18 10:38:09 +12:00
Sam Minnee
cc7a012139 BUGFIX: Use the copy of symfony-yaml bundled with Zend_Translate to prevent class conflicts. Remove now-unnecessary symonfy-yaml thirdparty lib. 2012-04-18 09:34:57 +12:00
Mateusz Uzdowski
705a29d00a BUGFIX: fix the ClassInfo::allClasses to fetch manifest data directly 2012-04-17 14:46:07 +12:00
Sean Harvey
5f73643e3f BUGFIX Hardcoding locales in installer, because we can't include i18n
properly, and including core/Core.php is too much.
2012-04-17 11:02:18 +12:00
Sean Harvey
ad2a21cc92 API CHANGE getSysTempDir() is now deprecated, use sys_get_temp_dir()
instead!
2012-04-17 10:53:41 +12:00
Sean Harvey
3ff6002936 ENHANCEMENT Always use sys_get_temp_dir() which will return the system
temp folder for PHP 5.2+, since we don't support older versions we don't
need to patch around this any longer.
2012-04-17 10:53:40 +12:00
Mateusz Uzdowski
b34be8190e BUGFIX: normalise the config file, PCRE does not handle Windows/Mac linebreaks (os7133) 2012-04-16 14:32:37 +12:00