Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ea833db5a |
21
.env.dist
21
.env.dist
@@ -8,24 +8,15 @@
|
||||
#
|
||||
# Real environment variables win over .env files.
|
||||
|
||||
# App mode (DEV, TEST, PROD)
|
||||
APP_MODE=DEV
|
||||
|
||||
# Including file with array of componens
|
||||
APP_COMPONENTS_FILE="config/components.php"
|
||||
|
||||
# Including file with array of app nodes
|
||||
APP_NODES_FILE="config/appnodes.php"
|
||||
|
||||
# Define app nodes
|
||||
#APP_NODE1='{"key":"/","action":"App\\Auth\\Controllers\\UserController","method":"index"}'
|
||||
#APP_NODE2='{"key":"/","router":"config/routes/main/collection.php"}'
|
||||
APP_COMPONENTS_FILE=config/app.php
|
||||
APP_NODES_FILE=config/nodes.php
|
||||
CONTAINER_DIR=config/container
|
||||
CONTAINER_CACHE=var/cache/container
|
||||
|
||||
# Default page
|
||||
PAGE404="templates/error/404.tpl"
|
||||
PAGE501="templates/error/501.tpl"
|
||||
PAGE404=templates/error/404.tpl
|
||||
PAGE501=templates/error/501.tpl
|
||||
|
||||
# Users environment
|
||||
|
||||
CONTAINER_DIR="config/container"
|
||||
MYSQL_PARAM='{"host":"host.docker.internal", "user":"***user***", "pass":"***password***","base":"***basename***", "logsEnable":true}'
|
||||
@@ -9,11 +9,4 @@ composer create-project rmphp/skeleton
|
||||
```
|
||||
```bash
|
||||
composer create-project rmphp/skeleton:"^1.0"
|
||||
```
|
||||
|
||||
|
||||
Dev version contains the latest changes
|
||||
|
||||
```bash
|
||||
composer create-project rmphp/skeleton:"1.0.x-dev"
|
||||
```
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
use DI\ContainerBuilder;
|
||||
|
||||
$containerDir = (getenv("CONTAINER_DIR"))?:"config/container/";
|
||||
$containerDir = (getenv("CONTAINER_DIR"))?:"config/container";
|
||||
$containerCache = (getenv("CONTAINER_CACHE"))?:"var/cache/container";
|
||||
|
||||
$dependencies = glob(dirname(__DIR__,2)."/".$containerDir."/*.php");
|
||||
|
||||
$dependenciesCollection = array_map(function ($dependenciesFile){
|
||||
return require $dependenciesFile;
|
||||
}, $dependencies);
|
||||
|
||||
try {
|
||||
$builder = new ContainerBuilder();
|
||||
$builder->enableCompilation(__DIR__ . '/../../var/cache/container');
|
||||
if(getenv("APP_MODE") != "DEV") $builder->enableCompilation(dirname(__DIR__,2)."/".$containerCache);
|
||||
$builder->addDefinitions(array_replace_recursive(...$dependenciesCollection));
|
||||
return $builder->build();
|
||||
} catch (Exception $e) {echo $e->getMessage();}
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
# Example:
|
||||
# ['key'=>'/', "action"=>"App\\Main\\Controllers\\IndexController", "method"=>"index"],
|
||||
# ['key'=>'/', 'router'=>'config/routes/main/collection.php'],
|
||||
# ['key'=>'/', 'router'=>'config/routes/main.json']
|
||||
# ['key'=>'/', 'router'=>'config/routes/main/routes.php'],
|
||||
# ['key'=>'/', 'router'=>'config/routes/main.yaml'],
|
||||
|
||||
return [
|
||||
@@ -1,14 +0,0 @@
|
||||
[
|
||||
{
|
||||
"key": "/",
|
||||
"routes": [
|
||||
{"action": "App\\Main\\Controllers\\IndexController", "method": "index", "params": ""}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "[any]",
|
||||
"routes": [
|
||||
{"action": "App\\Main\\Controllers\\IndexController", "method": "emptyAction", "params": ""}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user