mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/system-cron] Private instance variable as cron id
Changed cron lock to use a private instance variable for cron id instead of a constant. PHPBB3-9596
This commit is contained in:
parent
77d7238eef
commit
9be4f438eb
1 changed files with 5 additions and 3 deletions
|
@ -22,6 +22,8 @@ if (!defined('IN_PHPBB'))
|
|||
*/
|
||||
class cron_lock
|
||||
{
|
||||
private $cron_id;
|
||||
|
||||
function lock() {
|
||||
global $config, $db;
|
||||
|
||||
|
@ -44,10 +46,10 @@ class cron_lock
|
|||
}
|
||||
}
|
||||
|
||||
define('CRON_ID', time() . ' ' . unique_id());
|
||||
$this->cron_id = time() . ' ' . unique_id();
|
||||
|
||||
$sql = 'UPDATE ' . CONFIG_TABLE . "
|
||||
SET config_value = '" . $db->sql_escape(CRON_ID) . "'
|
||||
SET config_value = '" . $db->sql_escape($this->cron_id) . "'
|
||||
WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape($config['cron_lock']) . "'";
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
@ -65,7 +67,7 @@ class cron_lock
|
|||
|
||||
$sql = 'UPDATE ' . CONFIG_TABLE . "
|
||||
SET config_value = '0'
|
||||
WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape(CRON_ID) . "'";
|
||||
WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape($this->cron_id) . "'";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue