-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
Project configuration | ||
===================== | ||
Normally, the installer limits the modifications to be performed in the configuration files : | ||
|
||
Main configuration | ||
------------------ | ||
The main configuration of a project is localised in the ``app/conf/config.php`` file. | ||
:: | ||
<?php | ||
return array( | ||
"siteUrl"=>"%siteUrl%", | ||
"database"=>[ | ||
"dbName"=>"%dbName%", | ||
"serverName"=>"%serverName%", | ||
"port"=>"%port%", | ||
"user"=>"%user%", | ||
"password"=>"%password%" | ||
], | ||
"sessionToken"=>"%temporaryToken%", | ||
"namespaces"=>[], | ||
"templateEngine"=>'micro\views\engine\Twig', | ||
"templateEngineOptions"=>array("cache"=>false), | ||
"test"=>false, | ||
"debug"=>false, | ||
"di"=>[%injections%], | ||
"cacheDirectory"=>"cache/", | ||
"mvcNS"=>["models"=>"models","controllers"=>"controllers"] | ||
); | ||
|
||
Services configuration | ||
---------------------- | ||
Services loaded on startup are configured in the ``app/conf/services.php`` file. | ||
:: | ||
<?php | ||
use micro\cache\CacheManager; | ||
use micro\controllers\Router; | ||
use micro\orm\DAO; | ||
/*if($config["test"]){ | ||
\micro\log\Logger::init(); | ||
$config["siteUrl"]="http://127.0.0.1:8090/"; | ||
}*/ | ||
$db=$config["database"]; | ||
if($db["dbName"]!==""){ | ||
DAO::connect($db["dbName"],@$db["serverName"],@$db["port"],@$db["user"],@$db["password"]); | ||
} | ||
CacheManager::startProd($config); | ||
Router::start(); | ||
Router::addRoute("_default", "controllers\Main"); | ||
|
||
Pretty URLs | ||
----------- | ||
Apache | ||
^^^^^^ | ||
The framework ships with an **.htaccess** file that is used to allow URLs without index.php. If you use Apache to serve your Micro application, be sure to enable the **mod_rewrite** module. | ||
|
||
If the .htaccess file that ships with Laravel does not work with your Apache installation, try this one: | ||
|
||
:: | ||
AddDefaultCharset UTF-8 | ||
|
||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteBase /blog/ | ||
|
||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{HTTP_ACCEPT} !(.*images.*) | ||
RewriteRule ^(.*)$ index.php?c=$1 [L,QSA] | ||
</IfModule> | ||
|
||
Nginx | ||
^^^^^ | ||
On Nginx, the following directive in your site configuration will allow "pretty" URLs: | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?c=$query_string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters