Skip to content

Commit

Permalink
remove parameters from Application and put it into parameters.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fousjiri committed Nov 1, 2016
1 parent b7f9d66 commit eb68ad1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 51 deletions.
15 changes: 6 additions & 9 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
RewriteCond %{DOCUMENT_ROOT}/sites/%{HTTP_HOST}/web%{REQUEST_URI} -f
RewriteRule ^(.*)?$ sites/%{HTTP_HOST}/web/$1 [L]

# Redirect to the correct file on local environment
RewriteCond %{HTTP_HOST} (.*)\.twigyard\.localhost # remove on prdoduction
RewriteCond %{DOCUMENT_ROOT}/sites/%1/web%{REQUEST_URI} -f # remove on prdoduction
RewriteRule ^(.*)?$ sites/%1/web/$1 [L] # remove on prdoduction
# Redirect to the correct static file if parent_domain is set - remove on production start
RewriteCond %{HTTP_HOST} (.*)\.twigyard\.localhost
RewriteCond %{DOCUMENT_ROOT}/sites/%1/web%{REQUEST_URI} -f
RewriteRule ^(.*)?$ sites/%1/web/$1 [L]
# Remove on production end

# Redirect to front controller on production environemnt
RewriteCond %{HTTP_HOST} !.*\.twigyard\.localhost # remove on prdoduction
# Redirect to front controller
RewriteRule ^(.*)?$ web/app.php?httpauth=%{HTTP:Authorization} [QSA,L]

# Redirect to front controller on local environemnt
RewriteRule ^(.*)?$ web/app_dev.php?httpauth=%{HTTP:Authorization} [QSA,L] # remove on prdoduction

</IfModule>
7 changes: 7 additions & 0 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
parameters:
# enum debug, info, notice, warning, error, critical, alert, emergency
log_on_level: critical

cache_enabled: true
show_errors: false
tracking_enabled: true

# If enabled a new logfile is created every day.
log_rotation_enabled: false
log_max_files: 0
Expand Down
16 changes: 1 addition & 15 deletions web/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,7 @@

$appRoot = __DIR__ . '/..';
$config = $appRoot . '/app/config/config.yml';
$cacheEnabled = true;
$showErrors = false;
$trackingEnabled = true;

require_once($appRoot . '/vendor/autoload.php');

$logOnLevel = Logger::CRITICAL;

$app = new Application(
$appRoot,
$cacheEnabled,
$showErrors,
$trackingEnabled,
$logOnLevel,
new ApplicationConfig((new Yaml())->parse(file_get_contents($config)))
);

$app->run();
(new Application($appRoot, new ApplicationConfig((new Yaml())->parse(file_get_contents($config)))))->run();
27 changes: 0 additions & 27 deletions web/app_dev.php

This file was deleted.

0 comments on commit eb68ad1

Please sign in to comment.