addConfigValuesFromSystemSettings() public method

Adds config values that can be used to overwrite a plugin system setting and adds a description + default value for already existing configured config values that overwrite a plugin system setting.
public addConfigValuesFromSystemSettings ( array $configValues, SystemSettings[] $systemSettings ) : array
$configValues array
$systemSettings Piwik\Settings\Plugin\SystemSettings[]
return array
コード例 #1
0
ファイル: ConfigReaderTest.php プロジェクト: piwik/piwik
 public function test_addConfigValuesFromPluginSettings_shouldMaskValueIfTypeIsPassword()
 {
     $settings = new SystemSettings();
     $settings->metric->configureField()->uiControl = FieldConfig::UI_CONTROL_PASSWORD;
     $existing = array('ExampleSettingsPlugin' => array('metric' => array('value' => 'test', 'description' => '', 'isCustomValue' => false, 'defaultValue' => null)));
     $configValues = $this->configReader->addConfigValuesFromSystemSettings($existing, array($settings));
     $this->assertSame('******', $configValues['ExampleSettingsPlugin']['metric']['value']);
 }
コード例 #2
0
ファイル: Controller.php プロジェクト: piwik/piwik
 public function configfile()
 {
     Piwik::checkUserHasSuperUserAccess();
     $settings = new SettingsProvider(\Piwik\Plugin\Manager::getInstance());
     $allSettings = $settings->getAllSystemSettings();
     $configValues = $this->configReader->getConfigValuesFromFiles();
     $configValues = $this->configReader->addConfigValuesFromSystemSettings($configValues, $allSettings);
     $configValues = $this->sortConfigValues($configValues);
     return $this->renderTemplate('configfile', array('allConfigValues' => $configValues));
 }