mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 22:04:25 +02:00
Fix some coding standard violations in the StaticController
This commit is contained in:
parent
22b628c084
commit
a8e6daa678
@ -79,10 +79,7 @@ class StaticController extends Controller
|
|||||||
header(sprintf('ETag: "%x-%x-%x"', $s['ino'], $s['size'], (float) str_pad($s['mtime'], 16, '0')));
|
header(sprintf('ETag: "%x-%x-%x"', $s['ino'], $s['size'], (float) str_pad($s['mtime'], 16, '0')));
|
||||||
header('Cache-Control: public, max-age=3600');
|
header('Cache-Control: public, max-age=3600');
|
||||||
header('Pragma: cache');
|
header('Pragma: cache');
|
||||||
header('Last-Modified: ' . gmdate(
|
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $s['mtime']) . ' GMT');
|
||||||
'D, d M Y H:i:s',
|
|
||||||
$s['mtime']
|
|
||||||
) . ' GMT');
|
|
||||||
|
|
||||||
readfile($filePath);
|
readfile($filePath);
|
||||||
}
|
}
|
||||||
@ -99,7 +96,7 @@ class StaticController extends Controller
|
|||||||
$basedir = Icinga::app()->getApplicationDir('../public/js/icinga/components/');
|
$basedir = Icinga::app()->getApplicationDir('../public/js/icinga/components/');
|
||||||
$filePath = $basedir . $file;
|
$filePath = $basedir . $file;
|
||||||
} else {
|
} else {
|
||||||
if (!Icinga::app()->getModuleManager()->hasEnabled($module)) {
|
if (! Icinga::app()->getModuleManager()->hasEnabled($module)) {
|
||||||
Logger::error(
|
Logger::error(
|
||||||
'Non-existing frontend component "' . $module . '/' . $file
|
'Non-existing frontend component "' . $module . '/' . $file
|
||||||
. '" was requested. The module "' . $module . '" does not exist or is not active.'
|
. '" was requested. The module "' . $module . '" does not exist or is not active.'
|
||||||
@ -111,7 +108,7 @@ class StaticController extends Controller
|
|||||||
$filePath = $basedir . '/public/js/' . $file;
|
$filePath = $basedir . '/public/js/' . $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($filePath)) {
|
if (! file_exists($filePath)) {
|
||||||
Logger::error(
|
Logger::error(
|
||||||
'Non-existing frontend component "' . $module . '/' . $file
|
'Non-existing frontend component "' . $module . '/' . $file
|
||||||
. '" was requested, which would resolve to the the path: ' . $filePath
|
. '" was requested, which would resolve to the the path: ' . $filePath
|
||||||
@ -125,10 +122,7 @@ class StaticController extends Controller
|
|||||||
|
|
||||||
$response->setHeader(
|
$response->setHeader(
|
||||||
'Last-Modified',
|
'Last-Modified',
|
||||||
gmdate(
|
gmdate('D, d M Y H:i:s', filemtime($filePath)) . ' GMT'
|
||||||
'D, d M Y H:i:s',
|
|
||||||
filemtime($filePath)
|
|
||||||
) . ' GMT'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
readfile($filePath);
|
readfile($filePath);
|
||||||
@ -174,7 +168,7 @@ class StaticController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_response->setHeader('Content-Type', 'text/css');
|
$this->getResponse()->setHeader('Content-Type', 'text/css');
|
||||||
$this->setCacheHeader(3600);
|
$this->setCacheHeader(3600);
|
||||||
|
|
||||||
$lessCompiler->printStack();
|
$lessCompiler->printStack();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user