diff --git a/core/Core.php b/core/Core.php index 8d6efe463..bf1f61f96 100644 --- a/core/Core.php +++ b/core/Core.php @@ -78,6 +78,9 @@ require_once 'core/manifest/ManifestCache.php'; require_once 'core/manifest/ClassLoader.php'; require_once 'core/manifest/ConfigManifest.php'; require_once 'core/manifest/ConfigStaticManifest.php'; +if (file_exists('core/manifest/ConfigStaticManifest40.php')) { + require_once 'core/manifest/ConfigStaticManifest40.php'; +} require_once 'core/manifest/ClassManifest.php'; require_once 'core/manifest/ManifestFileFinder.php'; require_once 'core/manifest/TemplateLoader.php'; @@ -116,7 +119,11 @@ if(file_exists(BASE_PATH . '/vendor/autoload.php')) { require_once(BASE_PATH . '/framework/model/fieldtypes/compat/autoload.php'); // Now that the class manifest is up, load the static configuration -$configManifest = new SS_ConfigStaticManifest(BASE_PATH, false, $flush); +if (class_exists('SS_ConfigStaticManifest_40')) { + $configManifest = new SS_ConfigStaticManifest_40(BASE_PATH, false, $flush); +} else { + $configManifest = new SS_ConfigStaticManifest(BASE_PATH, false, $flush); +} Config::inst()->pushConfigStaticManifest($configManifest); // And then the yaml configuration diff --git a/core/manifest/ConfigStaticManifest40.php b/core/manifest/ConfigStaticManifest40.php new file mode 100644 index 000000000..4c222c935 --- /dev/null +++ b/core/manifest/ConfigStaticManifest40.php @@ -0,0 +1,67 @@ +name, $class) === 0) { + + if($reflection->hasProperty($name)) { + $property = $reflection->getProperty($name); + if($property->isStatic()) { + if(!$property->isPrivate()) { + Deprecation::notice('3.3', "Config static $class::\$$name must be marked as private", + Deprecation::SCOPE_GLOBAL); + return null; + } + $property->setAccessible(true); + return $property->getValue(); + } + } + + } + } + return null; + } + + public function getStatics() { + Deprecation::notice('3.3', 'This is no longer available as SS_ConfigStaticManifest now uses Reflection.'); + return array(); + } +} \ No newline at end of file