🔨 Déplace la config à l'extérieur
This commit is contained in:
parent
2efb54f0f8
commit
06cab08df4
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
.idea
|
||||
logs/
|
||||
deals/
|
||||
vendor/
|
||||
vendor/
|
||||
define.php
|
||||
|
11
cron.php
11
cron.php
@ -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
9
define.ini.php
Normal 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', '');
|
Loading…
Reference in New Issue
Block a user