Skip to content

Commit

Permalink
Adding base URI management
Browse files Browse the repository at this point in the history
  • Loading branch information
jfyoboue committed Feb 23, 2017
1 parent e5d251c commit fe79259
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# File .htaccess : /

Options -Indexes

Options +FollowSymlinks

RewriteEngine on

#RewriteCond %{REQUEST_FILE_NAME}% !-f
#RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{HTTP_ACCEPT} text/html|application/json|application/xml|text/xml

#RewriteRule ^(.*)$ web/app.php?url=$1 [QSA,L]
RewriteRule ^(.*)$ index.php
#RewriteRule ^(.*)$ web/app.php?url=$1 [QSA,L]
6 changes: 6 additions & 0 deletions app/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ protected function __construct($configFile = null, $mode = self::APP_MODE_PROD)
$this->config = $config;
$this->router = $router;

// Setting baseUri
if ($config->get('app_base_uri')) {
$this->baseUri = $config->get('app_base_uri');
}

// Injecting services container
$services = $this->config->get('services');
if (count($services) > 0) {
foreach($services as $key => $value) {
Expand Down
1 change: 1 addition & 0 deletions app/config/parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'app_version_code' => 1,
'app_version_name' => '1.0.0',
'app_base_url' => 'http://127.0.0.1:8008',
'app_base_uri' => '/',
'dir_root' => '',
'dir_assets' => '/web/assets',
'dir_data' => '/web/data',
Expand Down

0 comments on commit fe79259

Please sign in to comment.