Commit d07cabb4 authored by Fabian Reimeier's avatar Fabian Reimeier
Browse files

Dynamic catalog usage and refactoring.

parent d9f1e42f
......@@ -7,7 +7,7 @@ class Config {
static function get($group){
if (!isset($config)){
$cfile = (isset($_SERVER['HTTP_HOST'])) ? __DIR__.'/../../'.$_SERVER['HTTP_HOST'].'_conf.ini' : __DIR__.'/../../config.ini';
$cfile = (isset($_SERVER['HTTP_HOST'])) ? __DIR__.'/../../'.$_SERVER['HTTP_HOST'].'.conf' : __DIR__.'/../../application.conf';
$config = parse_ini_file($cfile, true);
}
return (isset($group)) ? $config[$group] : $config;
......
File deleted
......@@ -152,9 +152,11 @@ $app->group('/data', function() use ($app) {
});
$app->get('/catalog.gz', function ($request, $response, $args) {
$file = '../catalog.gz';
$file = '../'.$_SERVER['HTTP_HOST'].'.catalog.gz';
if(!file_exists($file))
return $this->view->render($response, '404.template.twig')->withStatus(404);
$fh = fopen($file, 'rb');
$stream = new \Slim\Http\Stream($fh); // create a stream instance for the response body
return $response->withHeader('Content-Type', 'application/force-download')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment