summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/Controller/IconController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/lib/Controller/IconController.php')
-rw-r--r--apps/theming/lib/Controller/IconController.php34
1 files changed, 14 insertions, 20 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php
index 78d41d621a0..6f97fdcdaba 100644
--- a/apps/theming/lib/Controller/IconController.php
+++ b/apps/theming/lib/Controller/IconController.php
@@ -73,7 +73,8 @@ class IconController extends Controller {
Util $util,
ITimeFactory $timeFactory,
IL10N $l,
- IRootFolder $rootFolder
+ IRootFolder $rootFolder,
+ IconBuilder $iconBuilder
) {
parent::__construct($appName, $request);
@@ -83,9 +84,10 @@ class IconController extends Controller {
$this->l = $l;
$this->config = $config;
$this->rootFolder = $rootFolder;
- if(extension_loaded('imagick')) {
- $this->iconBuilder = new IconBuilder($this->themingDefaults, $this->util);
- }
+ $this->iconBuilder = $iconBuilder;
+ //if(extension_loaded('imagick')) {
+ // $this->iconBuilder = new IconBuilder($this->themingDefaults, $this->util);
+ //}
}
/**
@@ -121,18 +123,13 @@ class IconController extends Controller {
if($this->themingDefaults->shouldReplaceIcons()) {
$icon = $this->iconBuilder->getFavicon($app);
$response = new DataDisplayResponse($icon, Http::STATUS_OK, ['Content-Type' => 'image/x-icon']);
- $response->cacheFor(86400);
- $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
- $response->addHeader('Pragma', 'cache');
- return $response;
} else {
$response = new DataDisplayResponse(null, Http::STATUS_NOT_FOUND);
- $response->cacheFor(86400);
- $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
- return $response;
}
-
-
+ $response->cacheFor(86400);
+ $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
+ $response->addHeader('Pragma', 'cache');
+ return $response;
}
/**
@@ -148,16 +145,13 @@ class IconController extends Controller {
if($this->themingDefaults->shouldReplaceIcons()) {
$icon = $this->iconBuilder->getTouchIcon($app);
$response = new DataDisplayResponse($icon, Http::STATUS_OK, ['Content-Type' => 'image/png']);
- $response->cacheFor(86400);
- $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
- $response->addHeader('Pragma', 'cache');
- return $response;
} else {
$response = new DataDisplayResponse(null, Http::STATUS_NOT_FOUND);
- $response->cacheFor(86400);
- $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
- return $response;
}
+ $response->cacheFor(86400);
+ $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
+ $response->addHeader('Pragma', 'cache');
+ return $response;
}