Browse Source

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

master
Clément Desmidt 4 years ago
parent
commit
06cab08df4
  1. 3
      .gitignore
  2. 11
      cron.php
  3. 9
      define.ini.php

3
.gitignore

@ -1,4 +1,5 @@
.idea
logs/
deals/
vendor/
vendor/
define.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

@ -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…
Cancel
Save