Browse Source

:hammer: Déplace la config à l'extérieur

master
Clément Desmidt 2 years ago
parent
commit
06cab08df4
3 changed files with 12 additions and 11 deletions
  1. +2
    -1
      .gitignore
  2. +1
    -10
      cron.php
  3. +9
    -0
      define.ini.php

+ 2
- 1
.gitignore View File

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

+ 1
- 10
cron.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
- 0
define.ini.php 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', '');

Loading…
Cancel
Save