Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -3,17 +3,17 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Task Manager Library
* Last Updated: $Date: 2010-08-30 19:21:56 -0400 (Mon, 30 Aug 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 6810 $
* @link http://hatynka.in
* @version $Rev: 8644 $
*
*/
@@ -63,7 +63,7 @@ class class_taskmanager
*
* @access public
* @param object ipsRegistry $registry
* @return void
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
@@ -93,8 +93,7 @@ class class_taskmanager
/**
* Run a task
*
* @access public
* @return void
* @return @e void
*/
public function runTask()
{
@@ -132,7 +131,7 @@ class class_taskmanager
/* Check to make sure the app is enabled and exists */
$this_task = $this->_checkAppEnabled( $this_task );
}
else
else if ( $this->type == 'cron' )
{
//-----------------------------------------
// Cron.. load from cron key
@@ -142,10 +141,17 @@ class class_taskmanager
'from' => 'task_manager',
'where' => "task_cronkey='".$this->cron_key."'",
) );
//-----------------------------------------
// Verify application is enabled
//-----------------------------------------
if ( ! $this_task['task_application'] OR ! ipsRegistry::$applications[ $this_task['task_application'] ]['app_enabled'] )
{
return;
}
}
if ( $this_task['task_id'] )
{
//-----------------------------------------
@@ -181,10 +187,10 @@ class class_taskmanager
$this->saveNextRunStamp();
if ( file_exists( IPSLib::getAppDir( $this_task['task_application'] ) . '/tasks/' . $this_task['task_file'] ) )
if ( is_file( IPSLib::getAppDir( $this_task['task_application'] ) . '/tasks/' . $this_task['task_file'] ) )
{
require_once( IPSLib::getAppDir( $this_task['task_application'] ) . '/tasks/' . $this_task['task_file'] );
$myobj = new task_item( $this->registry, $this, $this_task );
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( $this_task['task_application'] ) . '/tasks/' . $this_task['task_file'], 'task_item', $this_task['task_application'] );
$myobj = new $classToLoad( $this->registry, $this, $this_task );
$myobj->runTask();
//-----------------------------------------
@@ -219,7 +225,7 @@ class class_taskmanager
{
if( is_array($task) AND count($task) )
{
if ( !isset($task['task_id']) OR !$task['task_id'] )
if ( empty($task['task_id']) )
{
return false;
}
@@ -244,7 +250,7 @@ class class_taskmanager
* Update the task's next run timestamp
*
* @access public
* @return void
* @return @e void
*/
public function saveNextRunStamp()
{
@@ -477,7 +483,7 @@ class class_taskmanager
* @access public
* @param array Task data
* @param string Description to add to the log file
* @return void
* @return @e void
*/
public function appendTaskLog( $task, $desc )
{
@@ -490,7 +496,7 @@ class class_taskmanager
'log_date' => time(),
'log_ip' => my_getenv('REMOTE_ADDR'),
'log_desc' => $desc
);
);
$this->DB->insert( 'task_logs', $save );
}
@@ -499,7 +505,7 @@ class class_taskmanager
* Add a month to the next run timestamp
*
* @access protected
* @return void
* @return @e void
*/
protected function _addMonth()
{
@@ -519,7 +525,7 @@ class class_taskmanager
*
* @access protected
* @param integer Number of days to add
* @return void
* @return @e void
*/
protected function _addDay($days=1)
{
@@ -539,7 +545,7 @@ class class_taskmanager
*
* @access protected
* @param integer Number of hours to add
* @return void
* @return @e void
*/
protected function _addHour($hour=1)
{
@@ -559,7 +565,7 @@ class class_taskmanager
*
* @access protected
* @param integer Number of minutes to add
* @return void
* @return @e void
*/
protected function _addMinute($mins=1)
{
@@ -580,19 +586,16 @@ class class_taskmanager
* @param array Task Data
* @return array Task Data
*/
private function _checkAppEnabled( $task )
protected function _checkAppEnabled( $task )
{
if ( ! $task['task_application'] OR ! ipsRegistry::$applications[ $task['task_application'] ]['app_enabled'] )
{
/* Best update them all */
$_apps = array();
foreach( ipsRegistry::$applications as $appDir => $appData )
foreach( IPSLib::getEnabledApplications() as $appDir => $appData )
{
if ( $appData['app_enabled'] )
{
$_apps[] = "'" . $appDir . "'";
}
$_apps[] = "'" . $appDir . "'";
}
$this->DB->update( 'task_manager', array( 'task_enabled' => 0 ), 'task_application NOT IN (' . implode( ',', $_apps ) . ')' );
@@ -608,5 +611,4 @@ class class_taskmanager
return $task;
}
}
}