Bug #33622 ยป 33622.patch
Packages/Framework/TYPO3.FLOW3/Classes/Configuration/ConfigurationManager.php (revision ) | ||
---|---|---|
* @var string
|
||
*/
|
||
protected $context;
|
||
|
||
/**
|
||
|
||
/**
|
||
* COREPATCH Telekom
|
||
* by Peter Russ <peter.russ@telekom.de>
|
||
* 01.02.12: added additional configuration options
|
||
*
|
||
*/
|
||
/**
|
||
* The system the application is running on
|
||
* @var string
|
||
*/
|
||
protected $subSystem;
|
||
|
||
/**
|
||
* Static Configuration file path and name to overule settings by an system admin
|
||
* @var string
|
||
*/
|
||
protected $staticConfiguration;
|
||
|
||
/**
|
||
* end COREPATCH
|
||
*/
|
||
/**
|
||
* @var \TYPO3\FLOW3\Configuration\Source\YamlSource
|
||
*/
|
||
protected $configurationSource;
|
||
... | ... | |
* Constructs the configuration manager
|
||
*
|
||
* @param string $context The application context to fetch configuration for
|
||
* @param string $subSystem The application subsystem to fetch configuration for
|
||
*/
|
||
public function __construct($context) {
|
||
public function __construct($context, $subSystem = '') {
|
||
$this->context = $context;
|
||
$this->subSystem = $subSystem;
|
||
if (!is_dir(FLOW3_PATH_CONFIGURATION . $context) && !is_link(FLOW3_PATH_CONFIGURATION . $context)) {
|
||
\TYPO3\FLOW3\Utility\Files::createDirectoryRecursively(FLOW3_PATH_CONFIGURATION . $context);
|
||
}
|
||
... | ... | |
$this->loadConfigurationCache();
|
||
}
|
||
|
||
/**
|
||
/**
|
||
* COREPATCH Telekom
|
||
* by Peter Russ <peter.russ@telekom.de>
|
||
* 01.02.12: setter for addtional configuration options
|
||
*
|
||
*/
|
||
|
||
/**
|
||
* @param string Sets the subsystem this bootstrap was started in
|
||
*/
|
||
public function setSubSystem($subSystem) {
|
||
$this->subSystem = (string)$subSystem;
|
||
}
|
||
|
||
/**
|
||
* Sets the path and filename for a static configuration.
|
||
* This will overrule other Settings and allows an admin to set server specific settings
|
||
* without publishing them.
|
||
*
|
||
* @param string The static configuration file path and name. Ending .yaml will be added automatically!!!
|
||
*/
|
||
public function setStaticConfiguration($staticConfiguration) {
|
||
$this->staticConfiguration = (string)$staticConfiguration;
|
||
}
|
||
|
||
/**
|
||
* end COREPATCH
|
||
*/
|
||
/**
|
||
* Injects the configuration source
|
||
*
|
||
* @param \TYPO3\FLOW3\Configuration\Source\YamlSource $configurationSource
|
||
... | ... | |
foreach ($packages as $package) {
|
||
$settings = \TYPO3\FLOW3\Utility\Arrays::arrayMergeRecursiveOverrule($settings, $this->configurationSource->load($package->getConfigurationPath() . $this->context . '/' . self::CONFIGURATION_TYPE_SETTINGS));
|
||
}
|
||
$settings = \TYPO3\FLOW3\Utility\Arrays::arrayMergeRecursiveOverrule($settings, $this->configurationSource->load(FLOW3_PATH_CONFIGURATION . $this->context . '/' . self::CONFIGURATION_TYPE_SETTINGS));
|
||
$settings = \TYPO3\FLOW3\Utility\Arrays::arrayMergeRecursiveOverrule($settings, $this->configurationSource->load(FLOW3_PATH_CONFIGURATION . $this->context . '/' . self::CONFIGURATION_TYPE_SETTINGS));
|
||
/**
|
||
* COREPATCH Telekom
|
||
* by Peter Russ <peter.russ@telekom.de>
|
||
* 01.02.12: get settings for addtional configuration
|
||
*
|
||
*/
|
||
if (!empty($this->subSystem)) {
|
||
$settings = \TYPO3\FLOW3\Utility\Arrays::arrayMergeRecursiveOverrule($settings, $this->configurationSource->load(FLOW3_PATH_CONFIGURATION . $this->context . '/'. $this->subSystem . '.' . self::CONFIGURATION_TYPE_SETTINGS));
|
||
}
|
||
|
||
if (!empty($this->staticConfiguration)) {
|
||
$settings = \TYPO3\FLOW3\Utility\Arrays::arrayMergeRecursiveOverrule($settings, $this->configurationSource->load($this->staticConfiguration));
|
||
}
|
||
|
||
/**
|
||
* end COREPATCH
|
||
*/
|
||
if ($this->configurations[self::CONFIGURATION_TYPE_SETTINGS] !== array()) {
|
||
$this->configurations[self::CONFIGURATION_TYPE_SETTINGS] = \TYPO3\FLOW3\Utility\Arrays::arrayMergeRecursiveOverrule($this->configurations[self::CONFIGURATION_TYPE_SETTINGS], $settings);
|
||
} else {
|
||
... | ... | |
return $mergedSubRoutesConfigurations;
|
||
}
|
||
}
|
||
?>
|
||
?>
|
Web/index.php (revision ) | ||
---|---|---|
|
||
$context = getenv('FLOW3_CONTEXT') ?: (getenv('REDIRECT_FLOW3_CONTEXT') ?: 'Development');
|
||
$bootstrap = new \TYPO3\FLOW3\Core\Bootstrap($context);
|
||
/**
|
||
* COREPATCH Telekom
|
||
* by Peter Russ <peter.russ@telekom.de>
|
||
* 01.02.2012: added additional environment settings
|
||
*
|
||
*/
|
||
|
||
$subSystem = getenv('FLOW3_SUBSYSTEM') ?: '';
|
||
if (!empty($subSystem)) {
|
||
$bootstrap->setSubSystem($subSystem);
|
||
}
|
||
$staticConfiguration = getenv('FLOW3_STATIC_CONFIGURATION') ?: '';
|
||
if (!empty($staticConfiguration)) {
|
||
$bootstrap->setStaticConfiguration($staticConfiguration);
|
||
}
|
||
/**
|
||
* end COREPATCH
|
||
*/
|
||
$bootstrap->run();
|
||
|
||
?>
|
Packages/Framework/TYPO3.FLOW3/Classes/Core/Bootstrap.php (revision ) | ||
---|---|---|
*/
|
||
protected $context;
|
||
|
||
/**
|
||
/**
|
||
* COREPATCH Telekom
|
||
* by Peter Russ <peter.russ@telekom.de>
|
||
* 01.02.12: added additional configuration options
|
||
*
|
||
*/
|
||
/**
|
||
* The system the application is running on
|
||
* @var string
|
||
*/
|
||
protected $subSystem;
|
||
|
||
/**
|
||
* The path for a static configuration setting to overrule other settings by an admin
|
||
* @var string
|
||
*/
|
||
protected $staticConfiguration;
|
||
|
||
/**
|
||
* end COREPATCH
|
||
*/
|
||
/**
|
||
* @var \TYPO3\FLOW3\Configuration\ConfigurationManager
|
||
*/
|
||
protected $configurationManager;
|
||
... | ... | |
* Constructor
|
||
*
|
||
* @param string $context The application context
|
||
* @param string $subSystem The system the application is running on
|
||
* @return void
|
||
* @api
|
||
*/
|
||
public function __construct($context) {
|
||
public function __construct($context, $subSystem = '') {
|
||
$this->defineConstants();
|
||
$this->ensureRequiredEnvironment();
|
||
|
||
... | ... | |
require_once(FLOW3_PATH_FLOW3 . 'Tests/BaseTestCase.php');
|
||
require_once(FLOW3_PATH_FLOW3 . 'Tests/FunctionalTestCase.php');
|
||
}
|
||
|
||
if (!empty($subSystem)) {
|
||
$this->subSystem = (string)$subSystem;
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Returns the context this bootstrap was started in.
|
||
... | ... | |
return $this->context;
|
||
}
|
||
|
||
/**
|
||
/**
|
||
* COREPATCH Telekom
|
||
* by Peter Russ <peter.russ@telekom.de>
|
||
* 01.02.12: added getter and setter for additional configuration options
|
||
*
|
||
*/
|
||
/**
|
||
* @param string Sets the subsystem this bootstrap was started in
|
||
*/
|
||
public function setSubSystem($subSystem) {
|
||
$this->subSystem = (string)$subSystem;
|
||
}
|
||
|
||
/**
|
||
* Returns the subsystem this bootstrap was started in.
|
||
*
|
||
* @return string The subsystem, for example "MyVhost"
|
||
* @api
|
||
*/
|
||
public function getSubSystem() {
|
||
return $this->subSystem;
|
||
}
|
||
|
||
|
||
/**
|
||
* Sets the path and filename for a static configuration.
|
||
* This will overrule other Settings and allows an admin to set server specific settings
|
||
* without publishing them.
|
||
*
|
||
* @param string The static configuration file path and name. Ending .yaml will be added automatically!!!
|
||
* @api
|
||
*/
|
||
public function setStaticConfiguration($staticConfiguration) {
|
||
$this->staticConfiguration = (string)$staticConfiguration;
|
||
}
|
||
|
||
/**
|
||
* end COREPATCH
|
||
*/
|
||
/**
|
||
* Runs the the FLOW3 Framework by resolving an appropriate bootstrap sequence and passing control to it.
|
||
*
|
||
* @return void
|
||
... | ... | |
* @see initialize()
|
||
*/
|
||
protected function initializeConfiguration() {
|
||
/**
|
||
* COREPATCH Telekom
|
||
* by Peter Russ <peter.russ@telekom.de>
|
||
* 01.02.12: forward additional configuration option to configuration manager
|
||
*
|
||
*/
|
||
$this->configurationManager = new \TYPO3\FLOW3\Configuration\ConfigurationManager($this->context);
|
||
|
||
if (!empty($this->subSystem)) {
|
||
$this->configurationManager->setSubSystem($this->subSystem);
|
||
}
|
||
|
||
if (!empty($this->staticConfiguration)) {
|
||
$this->configurationManager->setStaticConfiguration($this->staticConfiguration);
|
||
}
|
||
|
||
/**
|
||
* end COREPATCH
|
||
*/
|
||
$this->configurationManager->injectConfigurationSource(new \TYPO3\FLOW3\Configuration\Source\YamlSource());
|
||
$this->configurationManager->setPackages($this->packageManager->getActivePackages());
|
||
|