Browse Source

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

master
Clément Desmidt 1 year 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 @@
1 1
 .idea
2 2
 logs/
3 3
 deals/
4
-vendor/
4
+vendor/
5
+define.php

+ 1
- 10
cron.php View File

@@ -1,19 +1,10 @@
1 1
 <?php
2 2
 include __DIR__ . '/vendor/autoload.php';
3
+include __DIR__ . '/define.php';
3 4
 
4 5
 use Monolog\Logger;
5 6
 use Monolog\Handler\StreamHandler;
6 7
 
7
-define('APP_DIR', __DIR__);
8
-define('DEALS_DIR', sprintf('%s/deals', APP_DIR));
9
-define('LOGS_DIR', sprintf('%s/logs', APP_DIR));
10
-define('NEW_DEALS_DIR', sprintf('%s/deals/new', APP_DIR));
11
-define('EXISTING_DEALS_DIR', sprintf('%s/deals/list', APP_DIR));
12
-define('BACKUP_DEALS_DIR', sprintf('%s/deals/backup', APP_DIR));
13
-define('LOG_MAIL_TO', '');
14
-define('LOG_MAIL_SUBJECT', '[LBCReposter] erreur cron');
15
-define('LOG_MAIL_FROM', '');
16
-
17 8
 $log = new Logger('lbcreposter');
18 9
 $log->pushHandler(new StreamHandler(LOGS_DIR.'/cron.log', Logger::WARNING));
19 10
 $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 @@
1
+define('APP_DIR',            __DIR__);
2
+define('DEALS_DIR',          sprintf('%s/deals', APP_DIR));
3
+define('LOGS_DIR',           sprintf('%s/logs', APP_DIR));
4
+define('NEW_DEALS_DIR',      sprintf('%s/deals/new', APP_DIR));
5
+define('EXISTING_DEALS_DIR', sprintf('%s/deals/list', APP_DIR));
6
+define('BACKUP_DEALS_DIR',   sprintf('%s/deals/backup', APP_DIR));
7
+define('LOG_MAIL_TO',        '');
8
+define('LOG_MAIL_SUBJECT',   '[LBCReposter] erreur cron');
9
+define('LOG_MAIL_FROM',      '');

Loading…
Cancel
Save