Commit Graph

2879 Commits

Author SHA1 Message Date
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
Ingo Schommer
d44f6b3e1f MINOR Removed deprecated usage of $priority argument in _t() calls 2012-04-15 17:17:17 +02:00
Ingo Schommer
bd23a07bba API CHANGE Using Zend_Translate with YAML translation files, replacing the $lang global and PHP files in the /lang folders. 2012-04-15 17:17:15 +02:00
Ingo Schommer
0a0be63ee2 ENHANCEMENT Added $exclusive flag to SS_ClassLoader->pushManifest() to allow for multiple manifests co-existing (useful for tests which rely on core classes but also want to test their own manifests) 2012-04-15 17:17:15 +02:00
Stig Lindqvist
5e79e81b31 MINOR ConfigManifest cache fixes
- Do not skip the cache if there are currently no environmental specific spec, just use the an empty variantKeySpec.
- When doing a regeneration of the config, clear the previous values from the array before regeneration.
2012-04-15 17:13:28 +02: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
Sean Harvey
6db8f85450 API CHANGE Enable E_STRICT, but include DebugView, Log classes as these are not always guaranteed to be loaded by ClassLoader at the time a strict error is issued. 2012-04-13 13:23:26 +12:00
Sean Harvey
aa14a5191e MINOR Temporarily disabled E_STRICT until we can solve Debug issues with
SS error handler
2012-04-13 12:03:01 +12:00
Sean Harvey
4c1aba8542 BUGFIX Object::get_extensions() is now declared as static, as it was
never an instance method
2012-04-12 12:02:13 +12:00
Sean Harvey
630bfcc823 MINOR error_reporting() now defaults to E_ALL | E_STRICT which means
strict errors are now reported *unless* the site is in live mode (which
supresses everything except fatal errors and warnings)
2012-04-12 12:01:15 +12:00
Ingo Schommer
e045ffeb29 Merge pull request #205 from AngryPHPNerd/sapphire
---

In SS-2.4 you can prefix files with an underscore to exclude them from manifest this can be useful for backups of old classes or huge data files.

I think this behaviour should be readded.

(I will add a unit test for this ...)
2012-04-11 17:32:34 +02:00
Sam Minnee
213a08aac7 BUGFIX: Ensure site works if executed in a chrooted enviornment where BASE_PATH is '/'. (#4069) 2012-04-11 10:30:34 +12:00
Sean Harvey
2f1b7c1c71 MINOR Removed references to ereg as comments 2012-04-10 22:19:17 +12:00
Ingo Schommer
40d73127ae MINOR Using late static binding instead of Object::create() calls 2012-04-04 17:10:31 +02:00
Ingo Schommer
6517f4496b Merge pull request #273 from ajoneil/sapphire
---

This allows DataList::create(SiteTree) as equivalent to Object::create(DataList, SiteTree), without
having to have a create() function on DataList.

Required for E_STRICT compliance, as child classes cant override create() if they change the arguments.

DBField::create() is also renamed to DBField::create_field(), as this does not just call the constructor, which all other cases of create() do.

Conflicts:
	tests/model/DateTest.php
	tests/model/DatetimeTest.php
2012-04-04 16:48:16 +02:00
Sean Harvey
dbc4be3e94 API CHANGE Removed Services_JSON library, as we use the built-in json functions instead. 2012-03-31 13:20:19 +13:00
Sean Harvey
8ae474b182 API CHANGE Remove use of Services_JSON and replace with json_encode() and json_decode()
API CHANGE Convert::json2array() will convert nested JSON structures to array as well for easier traversal, instead of array with nested objects.
2012-03-31 13:17:36 +13:00
Ingo Schommer
f0ee711f52 Merge pull request #275 from halkyon/e_strict_support
First round of fixes for E_STRICT compliance
2012-03-28 02:42:26 -07:00
Sean Harvey
e097f6e1a8 MINOR Fixes to method arguments in core classes for E_STRICT support.
API CHANGE Remove abstract static function and just use static functions
in Authenticator (PHP 5.3+ doesn't support abstract static functions)
2012-03-28 22:41:42 +13:00
Sean Harvey
cf014dc56d MINOR Replaced use of deprecated split() with preg_split() and fixed use of "&new Class()" which is deprecated in PHP 5.3
ENHANCEMENT E_DEPRECATED and E_USER_DEPRECATED are now handled as notice level errors in Debug.
2012-03-27 23:16:52 +13:00
Sean Harvey
fec5497873 MINOR Removed old array_fill_keys() replacement for PHP 5.1, which is no longer supported. 2012-03-27 20:09:01 +13:00
Andrew O'Neil
de2832e65f ENHANCEMENT: Allow Object::create() to be called with late static binding.
This allows DataList::create('SiteTree') as equivalent to Object::create('DataList', 'SiteTree'), without
having to have a create() function on DataList. Required for E_STRICT compliance.
2012-03-27 17:57:42 +13:00
Simon Welsh
4be8ab0c62 MINOR Move definition of CMS_DIR and CMS_PATH into cms/_config.php 2012-03-24 11:47:27 +13:00
AngryPHPNerd
42f8d9f77a - Readded check for _config.php in ClassManifest.
- Added UnitTest for files with underscore prefix.
2012-03-13 23:38:34 +01:00
Simon Welsh
2f7fa90fc4 BUGFIX BASE_PATH was trimming trailing whitespace in paths rather than trailing DIRECTORY_SEPARATORs. 2012-03-13 09:18:12 +13:00
Sean Harvey
f63497d6f9 ENHANCEMENT Extension arguments are now passed through to add_to_class()
static function on Extension classes.
BUGFIX FulltextSearchable didn't pass through arguments, use now
available $args parameter with FulltextSearchable::add_to_class()
2012-03-12 16:14:47 +13:00
Hamish Friedlander
05cf5a833b MINOR: Dump deprecation notices introduced by the config system to 3.1.0 as it breaks heaps of code 2012-03-09 18:16:45 +13:00
Hamish Friedlander
dff6c638ee ENHANCEMENT: Enable config manifest loading in core 2012-03-09 18:16:45 +13:00
Hamish Friedlander
7c94caa0cc BUGFIX: Fix TokenisedRegularExpression when matching expressions first element is an array 2012-03-09 18:16:44 +13:00
Hamish Friedlander
876f4c5299 API CHANGE: Modify extensions system to support new config system. Statics are now declared directly on extensions, and there is an add_to_class method extensions can hook into to modify class configuration 2012-03-09 18:16:44 +13:00
Hamish Friedlander
0ab171d7c0 API CHANGE: Add config property on Object as shortcut to objects own properties 2012-03-09 18:13:57 +13:00
Hamish Friedlander
1b05a337b8 API CHANGE: Strip out old static accessors from Object 2012-03-09 18:13:56 +13:00
Hamish Friedlander
d355cd5baf ENHANCEMENT: Add config layer - the Config access class itself, and the ConfigManfiest builder which parses in the yaml config files 2012-03-09 18:13:56 +13:00
Sam Minnee
adbcf61c56 MINOR: Minor fixes after new SS_List interfaces cleanup 2012-03-09 17:50:32 +13:00
Sam Minnee
a55e06f6b5 API CHANGE: Introduce SS_Limitable class for adding to SS_Lists that have limit capability.
API CHANGE: Deprecated SS_List::getRange() in favour of SS_Limitable::limit().
API CHANGE: Introduce SS_Limitable::limit($limit, $offset = 0) as the only modern way of specifying limits; deprecate all others.
2012-03-09 17:07:40 +13:00
Hamish Friedlander
407913f2cf MINOR: Add workaround for hitting XDebugs fairly conservative nesting level limit 2012-03-06 09:31:56 +13:00
Hamish Friedlander
927dbbe717 API-CHANGE: Global template variables can now be called directly using SSViewer_DataPresenter instead of needing to inherit off ViewableData 2012-03-06 09:11:46 +13:00
Dominik Beerbohm
7927fffc0a AP(RE)CHANGE Exclude files with the underscore prefix from manifest. 2012-03-03 15:10:09 +01:00
AngryPHPNerd
2457c4f0bc BUGFIX: Eescape / in RegExp. 2012-02-28 00:44:27 +01:00
AngryPHPNerd
0e2cbb0b88 Replace ereg with preg_* 2012-02-27 22:14:02 +01:00
Simon Welsh
7658e902fc BUGFIX Convert::html2raw() not correctly stripping script and style tags 2012-02-15 07:55:52 +13:00
Fred Condo
d370423825 Clean up trailing ?> per coding standard
All sapphire but the lang directory
2012-02-12 12:40:16 -08:00
Simon Welsh
741f104749 FEATURE Allow setting of constant CUSTOM_INCLUDE_PATH in _ss_enivronment.php which is prepended to the include path 2012-02-11 14:33:55 +13:00
Sam Minnée
2c770a6f8f Merge pull request #146 from simonwelsh/namespace-manifest
BUGFIX Namespaced classes were always having their namespace prepended t...
2012-01-06 15:58:46 -08:00
Ingo Schommer
4056b94f75 BUGFIX Improved ClassInfo::ancestry() performance through in-memory caching and removal of unnecessary is_object() check - get_class() will complain if its not passed an object already) 2012-01-02 16:49:33 +01:00
Simon Welsh
dd546a9888 BUGFIX Merge request arrays recursively 2011-12-23 17:48:49 +13:00
Simon Welsh
27a51ed7ed BUGFIX Namespaced classes were always having their namespace prepended to their base class 2011-12-23 10:24:42 +13:00
Ingo Schommer
05d19d9a82 Revert "MINOR Use json_decode() instead of the Services_JSON class if the function exists." - it breaks assumptions around Convert::json2array() only converting the *first* level of an object structure into an array, which in turn fails CMSMainTest and LeftAndMainTest (as well as some UI functionality relying on it). In order to introduce this change we have to fix these issues in a backwards compatible manner.
This reverts commit 3a006b77ae.
2011-12-18 20:17:41 +01:00
Hamish Friedlander
be9286fbc4 Merge pull request #132 from simonwelsh/namespace-manifest 2011-12-17 15:40:06 +13:00
Sam Minnée
fdb8665a43 Merge pull request #133 from simonwelsh/54_fixes
MINOR Change error reporting level to explicitly exclude values rather t...
2011-12-16 18:04:42 -08:00
Simon Welsh
10b09420be MINOR Change error reporting level to explicitly exclude values rather than using XOR. 2011-12-17 14:40:58 +13:00
Simon Welsh
da2ac79205 BUGFIX Check for the correct type for $data['namespace'] 2011-12-17 14:32:14 +13:00
Simon Welsh
3e6a91a07f ENHANCEMENT Allow ClassManifest to handle classes with namespaces, or that extend classes in namspaces or that implement interfaces in namespaces. 2011-12-17 14:03:53 +13:00
Sam Minnée
dd495fb8bf Merge pull request #130 from sminnee/master
Fixed tests for PHPUnit 3.6
2011-12-16 15:19:47 -08:00
Sam Minnee
70d40cf4df BUGFIX: Removed use of base "Exception" class in order to avoid failures on PHPUnit 3.6. 2011-12-17 11:51:40 +13:00
simonwelsh
3a006b77ae MINOR Use json_decode() instead of the Services_JSON class if the function exists. 2011-12-10 08:57:45 +13:00
Ingo Schommer
755663a00a BUGFIX Set default mbstring encoding in Core.php instead of main.php and cli-script.php so phpunit binary test runs behave consistently (same as running through TestRunner+cli-script.php). Fixes URLSegmentFilterTest 2011-12-04 13:32:03 +01:00
Ingo Schommer
9b27a4c1be ENHANCEMENT More flexible URL filtering through new URLSegmentFilter API. Support for multibyte URL segments through URLPathFilter::$default_allow_multibyte. Abstraction from Convert::raw2url() (and SiteTree->generateURLSegment()) 2011-11-29 11:04:08 +01:00
Sam Minnee
da64123116 MINOR: Removed use of deprecated ClassInfo::is_subclass_of 2011-10-29 17:34:32 +13:00
Sam Minnee
e5afa25522 MINOR: Use Deprecation class to indicate deprecated methods in core. 2011-10-29 17:34:31 +13:00
Sam Minnée
d88b39f292 Merge pull request #81 from stojg/release/object-create
MINOR Object::create should not call a constructor if there aren't one.
2011-10-28 16:34:58 -07:00
Simon Welsh
5ad5dfc7ed Changes error reporting level to explicitly exclude E_DREPRECATED and E_STRICT, rather than xor. 2011-10-29 10:28:18 +13: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
Stig Lindqvist
3a11bb2f66 MINOR Do not call a constructor if there aren't one.
This will fix a lot of unittests failing.
2011-10-27 18:13:41 +02:00
Fred Condo
9bd499617b Spelling correction
Found and fixed all misspellings of "[Hh]ierarchy"
2011-10-18 15:32:52 -07:00
Ingo Schommer
670eec95cb MINOR Documentation 2011-10-07 22:57:23 +02:00
Ingo Schommer
3a5b3af7c6 BUGFIX Fixed tag stacking in Diff.php thirdparty lib (AIR-71) 2011-10-07 14:12:52 +02:00
Ingo Schommer
03db2894db ENHANCEMENT Optional HTML escaping in Diff::compareHTML() (tested implicitly in DataDifferencerTest for sapphire) (AIR-56) 2011-10-07 14:12:52 +02:00
Ingo Schommer
72d5423ac5 MINOR Removed debug code from Diff.php 2011-10-07 14:12:52 +02:00
Ingo Schommer
d6f4b24066 MINOR Allowing array-based values in Diff->getHTMLChunks() by imploding on comma (AIR-39) 2011-10-07 14:12:51 +02:00
Sam Minnee
0601384cda BUGFIX: Reapply decorator statics if it has been removed and re-added. (merged from r100706) 2011-10-07 14:12:50 +02:00
Ingo Schommer
715638333e API CHANGE Obeying existing memory_limit settings in increase_memory_limmit_to(). Introduced set_increase_memory_limit_max() and set_increase_time_limit_max() 2011-10-07 14:12:48 +02:00
Will Rossiter
1732a17114 Merged new-orm into datagrid 2011-09-26 16:47:54 +13:00