Adjusted code based on feedback on PR (Pull-request)

This commit is contained in:
Silbinary Wolf 2016-01-05 21:05:04 +11:00 committed by Sam Minnée
parent 8f65c44865
commit 08bb23823b
2 changed files with 8 additions and 7 deletions

View File

@ -116,10 +116,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
if (defined('SS_USE_OLD_CONFIGSTATICMANIFEST') && SS_USE_OLD_CONFIGSTATICMANIFEST) {
$configManifest = new SS_ConfigStaticManifest(BASE_PATH, false, $flush);
if (defined('SS_CONFIGSTATICMANIFEST')) {
$configManifest = SS_CONFIGSTATICMANIFEST;
$configManifest = new $configManifest(BASE_PATH, false, $flush);
} else {
$configManifest = new SS_ConfigStaticManifest_40(BASE_PATH, false, $flush);
$configManifest = new SS_ConfigStaticManifest(BASE_PATH, false, $flush);
}
Config::inst()->pushConfigStaticManifest($configManifest);

View File

@ -6,7 +6,7 @@
* @package framework
* @subpackage manifest
*/
class SS_ConfigStaticManifest_40 extends SS_ConfigStaticManifest {
class SS_ConfigStaticManifest_Reflection extends SS_ConfigStaticManifest {
/**
* Constructs and initialises a new config static manifest, either loading the data
@ -25,7 +25,7 @@ class SS_ConfigStaticManifest_40 extends SS_ConfigStaticManifest {
* Completely regenerates the manifest file.
*/
public function regenerate($cache = true) {
Deprecation::notice('3.3', 'This is no longer available as SS_ConfigStaticManifest now uses Reflection. For backwards compatibility define SS_USE_OLD_CONFIGSTATICMANIFEST in your _ss_environment.php file.');
Deprecation::notice('3.4', 'This is no longer available as SS_ConfigStaticManifest now uses Reflection. For backwards compatibility define SS_USE_OLD_CONFIGSTATICMANIFEST in your _ss_environment.php file.');
}
/**
@ -46,7 +46,7 @@ class SS_ConfigStaticManifest_40 extends SS_ConfigStaticManifest {
$property = $reflection->getProperty($name);
if($property->isStatic()) {
if(!$property->isPrivate()) {
Deprecation::notice('3.3', "Config static $class::\$$name must be marked as private",
Deprecation::notice('3.4', "Config static $class::\$$name must be marked as private",
Deprecation::SCOPE_GLOBAL);
return null;
}
@ -61,7 +61,7 @@ class SS_ConfigStaticManifest_40 extends SS_ConfigStaticManifest {
}
public function getStatics() {
Deprecation::notice('3.3', 'This is no longer available as SS_ConfigStaticManifest now uses Reflection. For backwards compatibility define SS_USE_OLD_CONFIGSTATICMANIFEST in your _ss_environment.php file.');
Deprecation::notice('3.4', 'This is no longer available as SS_ConfigStaticManifest now uses Reflection. For backwards compatibility define SS_USE_OLD_CONFIGSTATICMANIFEST in your _ss_environment.php file.');
return array();
}
}