summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-09-01 11:15:08 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-09-01 11:15:08 +0200
commit4490422601824d920de5f9d6e3df0897dec0b414 (patch)
tree08d8541bf26d3cca726605ff2f4b86adb5396095 /config
parente76ba69f66d49320005054dbf5cad477c252ed31 (diff)
fix tests
Diffstat (limited to 'config')
-rw-r--r--config/appconfig.php46
1 files changed, 16 insertions, 30 deletions
diff --git a/config/appconfig.php b/config/appconfig.php
index e2cc01aec..5292d35a7 100644
--- a/config/appconfig.php
+++ b/config/appconfig.php
@@ -28,7 +28,6 @@ class AppConfig {
private $urlGenerator;
private $phpVersion;
private $ownCloudVersion;
- private $installedApps;
private $installedExtensions;
private $databaseType;
private $l10n;
@@ -43,7 +42,6 @@ class AppConfig {
IURLGenerator $urlGenerator,
$phpVersion,
$ownCloudVersion,
- $installedApps,
$installedExtensions,
$databaseType) {
$this->navigationManager = $navigationManager;
@@ -51,7 +49,6 @@ class AppConfig {
$this->urlGenerator = $urlGenerator;
$this->ownCloudVersion = $ownCloudVersion;
$this->phpVersion = $phpVersion;
- $this->installedApps = $installedApps;
$this->installedExtensions = $installedExtensions;
$this->databaseType = $databaseType;
$this->config = [];
@@ -85,7 +82,7 @@ class AppConfig {
foreach($defaults as $key => $value) {
if(!array_key_exists($key, $nav)) {
$nav[$key] = $value;
- }
+ }
}
}
}
@@ -99,7 +96,7 @@ class AppConfig {
if($key !== null) {
return $this->config[$key];
} else {
- return $this->config;
+ return $this->config;
}
}
@@ -111,7 +108,7 @@ class AppConfig {
// if key is missing, don't create a navigation
if(array_key_exists('navigation', $this->config)) {
$nav =& $this->config['navigation'];
-
+
$navConfig = [
'id' => $nav['id'],
'order' => $nav['order']
@@ -119,7 +116,7 @@ class AppConfig {
$navConfig['name'] = $this->l10n->t($nav['name']);
$navConfig['href'] = $this->urlGenerator->linkToRoute($nav['route']);
- $navConfig['icon'] = $this->urlGenerator->imagePath($nav['id'],
+ $navConfig['icon'] = $this->urlGenerator->imagePath($nav['id'],
$nav['icon']);
$this->navigationManager->add($navConfig);
@@ -132,7 +129,7 @@ class AppConfig {
* Registers all jobs in the config
*/
public function registerBackgroundJobs() {
- // FIXME: this is temporarily static because core jobs are not public
+ // FIXME: this is temporarily static because core jobs are not public
// yet, therefore legacy code
foreach ($this->config['jobs'] as $job) {
Backgroundjob::addRegularTask($job, 'run');
@@ -144,7 +141,7 @@ class AppConfig {
* Registers all hooks in the config
*/
public function registerHooks() {
- // FIXME: this is temporarily static because core emitters are not future
+ // 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);
@@ -168,14 +165,14 @@ class AppConfig {
if(array_key_exists('databases', $this->config)) {
if(!in_array($this->databaseType, $this->config['databases'])) {
$msg .= 'Database ' . $this->databaseType . ' not supported.' .
- 'App is only compatible with ' .
+ 'App is only compatible with ' .
implode(', ', $this->config['databases']);
}
}
-
+
// test dependencies
if(array_key_exists('dependencies', $this->config)) {
-
+
$deps = $this->config['dependencies'];
if(array_key_exists('php', $deps)) {
@@ -184,25 +181,14 @@ class AppConfig {
}
if(array_key_exists('owncloud', $deps)) {
- $msg .= $this->requireVersion($this->ownCloudVersion,
+ $msg .= $this->requireVersion($this->ownCloudVersion,
$deps['owncloud'], 'ownCloud');
}
- if(array_key_exists('apps', $deps)) {
- foreach ($deps['apps'] as $app => $versions) {
- if(array_key_exists($app, $this->installedApps)) {
- $msg .= $this->requireVersion($this->installedApps[$app],
- $versions, 'App ' . $app);
- } else {
- $msg .= 'ownCloud app ' . $app . ' required but not installed';
- }
- }
- }
-
if(array_key_exists('libs', $deps)) {
foreach ($deps['libs'] as $lib => $versions) {
if(array_key_exists($lib, $this->installedExtensions)) {
- $msg .= $this->requireVersion($this->installedExtensions[$lib],
+ $msg .= $this->requireVersion($this->installedExtensions[$lib],
$versions, 'PHP extension ' . $lib);
} else {
$msg .= 'PHP extension ' . $lib . ' required but not installed';
@@ -220,9 +206,9 @@ class AppConfig {
/**
* Compares a version with a version requirement string
* @param string $actual the actual version that is there
- * @param string $required a version requirement in the form of
+ * @param string $required a version requirement in the form of
* <=5.3,>4.5 versions are separated with a comma
- * @param string $versionType a description of the string that is prepended
+ * @param string $versionType a description of the string that is prepended
* to the error message
* @return string an error message if the version is not met,
* empty string if ok
@@ -236,8 +222,8 @@ class AppConfig {
continue;
}
if(!version_compare($actual, $version['version'], $version['operator'])) {
- return $versionType . ' Version not satisfied: ' . $version['operator'] .
- $version['version'] . ' required but found ' . $actual . '\n';
+ return $versionType . ' Version not satisfied: ' . $version['operator'] .
+ $version['version'] . ' required but found ' . $actual . '\n';
}
}
@@ -247,7 +233,7 @@ class AppConfig {
/**
* Versions can be separated by a comma so split them
- * @param string $versions a version requirement in the form of
+ * @param string $versions a version requirement in the form of
* <=5.3,>4.5 versions are separated with a comma
* @return array of arrays with key=version value=operator
*/