🔨 Déplace la config à l'extérieur

This commit is contained in:
Clément Desmidt 2017-11-16 22:25:31 +01:00
parent 2efb54f0f8
commit 06cab08df4
3 changed files with 12 additions and 11 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
.idea
logs/
deals/
vendor/
vendor/
define.php

View File

@ -1,19 +1,10 @@
<?php
include __DIR__ . '/vendor/autoload.php';
include __DIR__ . '/define.php';
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
define('APP_DIR', __DIR__);
define('DEALS_DIR', sprintf('%s/deals', APP_DIR));
define('LOGS_DIR', sprintf('%s/logs', APP_DIR));
define('NEW_DEALS_DIR', sprintf('%s/deals/new', APP_DIR));
define('EXISTING_DEALS_DIR', sprintf('%s/deals/list', APP_DIR));
define('BACKUP_DEALS_DIR', sprintf('%s/deals/backup', APP_DIR));
define('LOG_MAIL_TO', '');
define('LOG_MAIL_SUBJECT', '[LBCReposter] erreur cron');
define('LOG_MAIL_FROM', '');
$log = new Logger('lbcreposter');
$log->pushHandler(new StreamHandler(LOGS_DIR.'/cron.log', Logger::WARNING));
$log->pushHandler(new \Monolog\Handler\NativeMailerHandler(LOG_MAIL_TO, LOG_MAIL_SUBJECT, LOG_MAIL_FROM));

9
define.ini.php Normal file
View File

@ -0,0 +1,9 @@
define('APP_DIR', __DIR__);
define('DEALS_DIR', sprintf('%s/deals', APP_DIR));
define('LOGS_DIR', sprintf('%s/logs', APP_DIR));
define('NEW_DEALS_DIR', sprintf('%s/deals/new', APP_DIR));
define('EXISTING_DEALS_DIR', sprintf('%s/deals/list', APP_DIR));
define('BACKUP_DEALS_DIR', sprintf('%s/deals/backup', APP_DIR));
define('LOG_MAIL_TO', '');
define('LOG_MAIL_SUBJECT', '[LBCReposter] erreur cron');
define('LOG_MAIL_FROM', '');