Skip to content

Commit

Permalink
Customisable constants.local.php (FreshRSS#1725)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkarex authored Dec 16, 2017
1 parent 78b6807 commit dcb41d6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
constants.local.php
67 changes: 41 additions & 26 deletions constants.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,50 @@
<?php
//NB: Do not edit; use ./constants.local.php instead.

//<Not customisable>
define('FRESHRSS_VERSION', '1.8.1-dev');
define('FRESHRSS_WEBSITE', 'https://freshrss.org');
define('FRESHRSS_WIKI', 'https://freshrss.github.io/FreshRSS/');

define('FRESHRSS_USERAGENT', 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')');
define('FRESHRSS_PATH', __DIR__);
define('PUBLIC_PATH', FRESHRSS_PATH . '/p');
define('PUBLIC_TO_INDEX_PATH', '/i');
define('INDEX_PATH', PUBLIC_PATH . PUBLIC_TO_INDEX_PATH);
define('PUBLIC_RELATIVE', '..');
define('LIB_PATH', FRESHRSS_PATH . '/lib');
define('APP_PATH', FRESHRSS_PATH . '/app');
define('EXTENSIONS_PATH', FRESHRSS_PATH . '/extensions');
//</Not customisable>

function safe_define($name, $value) {
if (!defined($name)) {
return define($name, $value);
}
}

if (file_exists(__DIR__ . '/constants.local.php')) {
//Include custom / local settings:
include(__DIR__ . '/constants.local.php');
}

safe_define('FRESHRSS_USERAGENT', 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')');

// PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level)
define('PHP_COMPRESSION', false);
safe_define('PHP_COMPRESSION', false);

// Maximum log file size in Bytes, before it will be divided by two
define('MAX_LOG_SIZE', 1048576);

// Constantes de chemins
define('FRESHRSS_PATH', dirname(__FILE__));

define('PUBLIC_PATH', FRESHRSS_PATH . '/p');
define('PUBLIC_TO_INDEX_PATH', '/i');
define('INDEX_PATH', PUBLIC_PATH . PUBLIC_TO_INDEX_PATH);
define('PUBLIC_RELATIVE', '..');

define('DATA_PATH', FRESHRSS_PATH . '/data');
define('UPDATE_FILENAME', DATA_PATH . '/update.php');
define('USERS_PATH', DATA_PATH . '/users');
define('ADMIN_LOG', USERS_PATH . '/_/log.txt');
define('API_LOG', USERS_PATH . '/_/log_api.txt');
define('CACHE_PATH', DATA_PATH . '/cache');
define('PSHB_LOG', USERS_PATH . '/_/log_pshb.txt');
define('PSHB_PATH', DATA_PATH . '/PubSubHubbub');

define('LIB_PATH', FRESHRSS_PATH . '/lib');
define('APP_PATH', FRESHRSS_PATH . '/app');
define('EXTENSIONS_PATH', FRESHRSS_PATH . '/extensions');

define('TMP_PATH', sys_get_temp_dir());
safe_define('MAX_LOG_SIZE', 1048576);

//This directory must be writable
safe_define('DATA_PATH', FRESHRSS_PATH . '/data');

safe_define('UPDATE_FILENAME', DATA_PATH . '/update.php');
safe_define('USERS_PATH', DATA_PATH . '/users');
safe_define('ADMIN_LOG', USERS_PATH . '/_/log.txt');
safe_define('API_LOG', USERS_PATH . '/_/log_api.txt');
safe_define('CACHE_PATH', DATA_PATH . '/cache');
safe_define('PSHB_LOG', USERS_PATH . '/_/log_pshb.txt');
safe_define('PSHB_PATH', DATA_PATH . '/PubSubHubbub');

//Directory used for feed mutex with *.freshrss.lock files. Must be writable.
safe_define('TMP_PATH', sys_get_temp_dir());

0 comments on commit dcb41d6

Please sign in to comment.