diff options
| author | 2017-12-17 00:00:43 +0100 | |
|---|---|---|
| committer | 2017-12-17 00:00:43 +0100 | |
| commit | e6c1c7d4cb62ff6638a22c90f2d734f4a08a4541 (patch) | |
| tree | f5a3b8920ad799b6fa2e3e0bd0a699bb3a1583a6 | |
| parent | 425958af5a2d64113ad352e983cd810bc829735e (diff) | |
| parent | dc9ae355b93a7188c9f26a5ccb3a59765e813529 (diff) | |
Merge branch 'FreshRSS/dev' into Minz_Dispatcher_paths
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | constants.php | 67 | ||||
| -rw-r--r-- | lib/Minz/Log.php | 1 |
4 files changed, 46 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..cd2fd5d3a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +constants.local.php diff --git a/CHANGELOG.md b/CHANGELOG.md index e4dbc63fb..85fc76aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,14 @@ * Add more Unicode glyphs in the Open Sans font [#1032](https://github.com/FreshRSS/FreshRSS/pull/1032) * Show URL to add subscriptions from third-party tools [#1247](https://github.com/FreshRSS/FreshRSS/issues/1247) * Improved message when checking for new versions [#1586](https://github.com/FreshRSS/FreshRSS/issues/1586) + * Hebrew [#1716](https://github.com/FreshRSS/FreshRSS/pull/1716) * SimplePie * Remove "SimplePie" name from HTTP User-Agent string [#1656](https://github.com/FreshRSS/FreshRSS/pull/1656) * Bug fixing * Work-around for `CURLOPT_FOLLOWLOCATION` `open_basedir` bug in favicons and PubSubHubbub [#1655](https://github.com/FreshRSS/FreshRSS/issues/1655) * Fix PDO PostgreSQL detection [#1690](https://github.com/FreshRSS/FreshRSS/issues/1690) * Fix punycode warning in PHP 7.2 [#1699](https://github.com/FreshRSS/FreshRSS/issues/1699) + * Fix ExtensionManager exception handling [#1724](https://github.com/FreshRSS/FreshRSS/pull/1724) * CLI * New command `./cli/db-optimize.php` for database optimisation [#1583](https://github.com/FreshRSS/FreshRSS/issues/1583) * Check PHP requirements before running `actualize_script.php` (cron for refreshing feeds) [#1711](https://github.com/FreshRSS/FreshRSS/pull/1711) @@ -27,6 +29,7 @@ * Show existing extensions in admin panel [#1708](https://github.com/FreshRSS/FreshRSS/pull/1708) * New function `$entry->_hash($hex)` for extensions that change the content of entries [#1707](https://github.com/FreshRSS/FreshRSS/pull/1707) * Misc. + * Customisable `constants.local.php` [#1725](https://github.com/FreshRSS/FreshRSS/pull/1725) * Basic mechanism to limit the size of the logs [#1712](https://github.com/FreshRSS/FreshRSS/pull/1712) * Translation validation tool [#1653](https://github.com/FreshRSS/FreshRSS/pull/1653) * Translation manipulation tool [#1658](https://github.com/FreshRSS/FreshRSS/pull/1658) diff --git a/constants.php b/constants.php index 576be09b9..2c791c3c5 100644 --- a/constants.php +++ b/constants.php @@ -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()); diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php index 5e7831cdb..a8dbf8350 100644 --- a/lib/Minz/Log.php +++ b/lib/Minz/Log.php @@ -98,6 +98,7 @@ class Minz_Log { rewind($fp); ftruncate($fp, 0); fwrite($fp, $content ? $content : ''); + fwrite($fp, sprintf("[%s] [notice] --- Log rotate.\n", date('r'))); fflush($fp); flock($fp, LOCK_UN); } else { |
