new config option: LOCK_DIRECTORY (bump config version)
This commit is contained in:
parent
e3b9d084d4
commit
cfa43e025c
|
@ -170,7 +170,11 @@
|
||||||
// option can be used to integrate tt-rss with Apache's external
|
// option can be used to integrate tt-rss with Apache's external
|
||||||
// authentication modules.
|
// authentication modules.
|
||||||
|
|
||||||
define('CONFIG_VERSION', 13);
|
define('LOCK_DIRECTORY', '.');
|
||||||
|
// Directory for lockfiles, must be writable to the user you run
|
||||||
|
// daemon process or cronjobs under.
|
||||||
|
|
||||||
|
define('CONFIG_VERSION', 14);
|
||||||
// Expected config version. Please update this option in config.php
|
// Expected config version. Please update this option in config.php
|
||||||
// if necessary (after migrating all new options from this file).
|
// if necessary (after migrating all new options from this file).
|
||||||
|
|
||||||
|
|
|
@ -1857,7 +1857,7 @@
|
||||||
function file_is_locked($filename) {
|
function file_is_locked($filename) {
|
||||||
if (function_exists('flock')) {
|
if (function_exists('flock')) {
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
$fp = fopen($filename, "r");
|
$fp = fopen(LOCK_DIRECTORY . "/$filename", "r");
|
||||||
error_reporting(DEFAULT_ERROR_LEVEL);
|
error_reporting(DEFAULT_ERROR_LEVEL);
|
||||||
if ($fp) {
|
if ($fp) {
|
||||||
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
||||||
|
@ -1873,7 +1873,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_lockfile($filename) {
|
function make_lockfile($filename) {
|
||||||
$fp = fopen($filename, "w");
|
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
|
||||||
|
|
||||||
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
||||||
return $fp;
|
return $fp;
|
||||||
|
@ -1883,7 +1883,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_stampfile($filename) {
|
function make_stampfile($filename) {
|
||||||
$fp = fopen($filename, "w");
|
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
|
||||||
|
|
||||||
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
||||||
fwrite($fp, time() . "\n");
|
fwrite($fp, time() . "\n");
|
||||||
|
@ -1898,7 +1898,7 @@
|
||||||
function read_stampfile($filename) {
|
function read_stampfile($filename) {
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
$fp = fopen($filename, "r");
|
$fp = fopen(LOCK_DIRECTORY . "/$filename", "r");
|
||||||
error_reporting (DEFAULT_ERROR_LEVEL);
|
error_reporting (DEFAULT_ERROR_LEVEL);
|
||||||
|
|
||||||
if (flock($fp, LOCK_EX)) {
|
if (flock($fp, LOCK_EX)) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once "functions.php";
|
require_once "functions.php";
|
||||||
|
|
||||||
define('EXPECTED_CONFIG_VERSION', 13);
|
define('EXPECTED_CONFIG_VERSION', 14);
|
||||||
define('SCHEMA_VERSION', 28);
|
define('SCHEMA_VERSION', 28);
|
||||||
|
|
||||||
if (!file_exists("config.php")) {
|
if (!file_exists("config.php")) {
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
error_reporting(DEFAULT_ERROR_LEVEL);
|
error_reporting(DEFAULT_ERROR_LEVEL);
|
||||||
|
|
||||||
function sigint_handler() {
|
function sigint_handler() {
|
||||||
unlink("update_daemon.lock");
|
unlink(LOCK_DIRECTORY . "/update_daemon.lock");
|
||||||
die("Received SIGINT. Exiting.\n");
|
die("Received SIGINT. Exiting.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,5 +56,5 @@
|
||||||
|
|
||||||
db_close($link);
|
db_close($link);
|
||||||
|
|
||||||
unlink($lock_filename);
|
unlink(LOCK_DIRECTORY . "/$lock_filename");
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue