Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+15 -4
View File
@@ -113,6 +113,11 @@ abstract class _Standard extends \IPS\Dispatcher
parent::finish();
}
/**
* @brief Initialize tasks
*/
protected $runTasks = FALSE;
/**
* Init
*
@@ -121,6 +126,8 @@ abstract class _Standard extends \IPS\Dispatcher
*/
public function init()
{
$this->runTasks = (bool) \IPS\Member::loggedIn()->member_id;
/* Force HTTPs and correct domain (e.g. not "www." if that's not in the base URL) */
if ( mb_strtolower( $_SERVER['REQUEST_METHOD'] ) == 'get' )
{
@@ -297,6 +304,12 @@ abstract class _Standard extends \IPS\Dispatcher
}
}
/**
* @brief Enable destruct method
* @note Disable to avoid an automatic database connection
*/
public $destruct = true;
/**
* Destructor
* Runs tasks
@@ -306,17 +319,15 @@ abstract class _Standard extends \IPS\Dispatcher
public function __destruct()
{
/* If you visit and you are redirected to installer, this code should not run */
if( !file_exists( \IPS\SITE_FILES_PATH . '/conf_global.php' ) )
if( !file_exists( \IPS\SITE_FILES_PATH . '/conf_global.php' ) OR !$this->destruct )
{
return;
}
if ( \IPS\Member::loggedIn()->member_id and \IPS\Settings::i()->task_use_cron == 'normal' and !\IPS\Request::i()->isAjax() )
if ( $this->runTasks and \IPS\Settings::i()->task_use_cron == 'normal' and !\IPS\Request::i()->isAjax() )
{
try
{
\IPS\Db::i()->readWriteSeparation = FALSE;
$task = \IPS\Task::queued();
if ( $task )
{