summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 18:19:23 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 18:19:23 +0200
commit66c73a96ac2dda076bcfe0dc0a1ca2a7e169149d (patch)
treedc0318fa459e4f313217ee38e4bc63524513d721 /config
parentf5e64d35c05b14016eb4fffff7199386a97a9b43 (diff)
first try to set indention limit at 80 characters in php
Diffstat (limited to 'config')
-rw-r--r--config/appconfig.php30
-rw-r--r--config/config.php37
2 files changed, 43 insertions, 24 deletions
diff --git a/config/appconfig.php b/config/appconfig.php
index a9045eb9a..62e1490ee 100644
--- a/config/appconfig.php
+++ b/config/appconfig.php
@@ -52,7 +52,8 @@ class AppConfig {
/**
- * @param string|array $data path to the config file or an array with the config
+ * @param string|array $data path to the config file or an array with the
+ * config
*/
public function loadConfig($data) {
if(is_array($data)) {
@@ -122,7 +123,8 @@ class AppConfig {
'name' => $nav['name']
];
- $navConfig['href'] = $this->urlGenerator->linkToRoute($nav['route']);
+ $navConfig['href'] =
+ $this->urlGenerator->linkToRoute($nav['route']);
$navConfig['icon'] = $this->urlGenerator->imagePath($nav['id'],
$nav['icon']);
@@ -157,8 +159,8 @@ class AppConfig {
* Registers all hooks in the config
*/
public function registerHooks() {
- // FIXME: this is temporarily static because core emitters are not future
- // proof, therefore legacy code in here
+ // FIXME: this is temporarily static because core emitters are not
+ // future proof, therefore legacy code in here
foreach ($this->config['hooks'] as $listen => $react) {
$listener = explode('::', $listen);
$reaction = explode('::', $react);
@@ -200,10 +202,13 @@ class AppConfig {
if (array_key_exists('libs', $deps)) {
foreach ($deps['libs'] as $lib => $versions) {
if(array_key_exists($lib, $this->installedExtensions)) {
- return $this->requireVersion($this->installedExtensions[$lib],
- $versions, 'PHP extension ' . $lib);
+ return $this->requireVersion(
+ $this->installedExtensions[$lib],
+ $versions, 'PHP extension ' . $lib
+ );
} else {
- return 'PHP extension ' . $lib . ' required but not installed';
+ return 'PHP extension ' . $lib .
+ ' required but not installed';
}
}
}
@@ -249,9 +254,11 @@ class AppConfig {
if($version['version'] === '*') {
continue;
}
- if(!version_compare($actual, $version['version'], $version['operator'])) {
- return $versionType . ' Version not satisfied: ' . $version['operator'] .
- $version['version'] . ' required but found ' . $actual . '\n';
+ $operator = $version['operator'];
+ $requiredVersion = $version['version'];
+ if(!version_compare($actual, $requiredVersion, $operator)) {
+ return $versionType . ' Version not satisfied: ' . $operator .
+ $requiredVersion . ' required but found ' . $actual . '\n';
}
}
@@ -270,7 +277,8 @@ class AppConfig {
$versions = explode(',', $versions);
foreach($versions as $version) {
- preg_match('/^(?<operator><|<=|>=|>|<>)?(?<version>.*)$/', $version, $matches);
+ preg_match('/^(?<operator><|<=|>=|>|<>)?(?<version>.*)$/', $version,
+ $matches);
if($matches['operator'] !== '') {
$required = [
'version' => $matches['version'],
diff --git a/config/config.php b/config/config.php
index 25e8a2294..44650c3ac 100644
--- a/config/config.php
+++ b/config/config.php
@@ -156,8 +156,10 @@ class Config {
$configValues = parse_ini_string($content);
if($configValues === false || count($configValues) === 0) {
- $this->logger->warning('Configuration invalid. Ignoring values.',
- $this->loggerParams);
+ $this->logger->warning(
+ 'Configuration invalid. Ignoring values.',
+ $this->loggerParams
+ );
} else {
foreach($configValues as $key => $value) {
@@ -166,8 +168,11 @@ class Config {
settype($value, $type);
$this->$key = $value;
} else {
- $this->logger->warning('Configuration value "' . $key .
- '" does not exist. Ignored value.' , $this->loggerParams);
+ $this->logger->warning(
+ 'Configuration value "' . $key .
+ '" does not exist. Ignored value.' ,
+ $this->loggerParams
+ );
}
}
@@ -178,15 +183,21 @@ class Config {
public function write($configPath) {
$ini =
- "autoPurgeMinimumInterval = " . $this->autoPurgeMinimumInterval . "\n" .
- "autoPurgeCount = " . $this->autoPurgeCount . "\n" .
- "simplePieCacheDuration = " . $this->simplePieCacheDuration . "\n" .
- "feedFetcherTimeout = " . $this->feedFetcherTimeout . "\n" .
- "useCronUpdates = " . var_export($this->useCronUpdates, true) . "\n" .
- "proxyHost = " . $this->proxyHost . "\n" .
- "proxyPort = " . $this->proxyPort . "\n" .
- "proxyUser = " . $this->proxyUser . "\n" .
- "proxyPassword = " . $this->proxyPassword;
+ 'autoPurgeMinimumInterval = ' .
+ $this->autoPurgeMinimumInterval . "\n" .
+ 'autoPurgeCount = ' .
+ $this->autoPurgeCount . "\n" .
+ 'simplePieCacheDuration = ' .
+ $this->simplePieCacheDuration . "\n" .
+ 'feedFetcherTimeout = ' .
+ $this->feedFetcherTimeout . "\n" .
+ 'useCronUpdates = ' .
+ var_export($this->useCronUpdates, true) . "\n" .
+
+ 'proxyHost = ' . $this->proxyHost . "\n" .
+ 'proxyPort = ' . $this->proxyPort . "\n" .
+ 'proxyUser = ' . $this->proxyUser . "\n" .
+ 'proxyPassword = ' . $this->proxyPassword;
;
$this->fileSystem->file_put_contents($configPath, $ini);