fix: add config.php as ignored
This commit is contained in:
parent
b65642cd0a
commit
14165f6e04
4 changed files with 12 additions and 29 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
tmp
|
||||
|
||||
config.php
|
||||
|
|
|
@ -17,7 +17,9 @@ return [
|
|||
'quickupload' => [
|
||||
'auth' => true
|
||||
],
|
||||
'logator' => []
|
||||
'logator' => [
|
||||
'alias' => ['logme']
|
||||
]
|
||||
],
|
||||
'auth' => [
|
||||
'root' => 'password'
|
||||
|
|
27
config.php
27
config.php
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'domain' => 'lefuturiste.fr',
|
||||
'modules' => [
|
||||
'random' => [],
|
||||
'date' => [
|
||||
'alias' => ['printdate']
|
||||
],
|
||||
'httpbin' => [],
|
||||
'printip' => [
|
||||
'alias' => ['ip', 'getip']
|
||||
],
|
||||
'quicknote' => [
|
||||
'auth' => true
|
||||
],
|
||||
'quickupload' => [
|
||||
'auth' => true
|
||||
],
|
||||
'logator' => [
|
||||
'alias' => ['logme']
|
||||
]
|
||||
],
|
||||
'auth' => [
|
||||
'root' => 'password'
|
||||
]
|
||||
];
|
|
@ -1,7 +1,15 @@
|
|||
<?php
|
||||
|
||||
if (!file_exists('./config.php')) {
|
||||
die('Config file not present');
|
||||
}
|
||||
|
||||
$config = require('./config.php');
|
||||
|
||||
if (!is_array($config)) {
|
||||
die('Config must be an array');
|
||||
}
|
||||
|
||||
// a basic validation of config keys
|
||||
if (!(isset($config['domain']) && strlen($config['domain']) > 0)) {
|
||||
die('Domain key not present in config');
|
||||
|
|
Loading…
Reference in a new issue