Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Clean out 'dead' sessions, validations, registration image entires, etc
|
||||
* Last Updated: $LastChangedDate: 2010-07-28 05:00:44 -0400 (Wed, 28 Jul 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 6708 $
|
||||
* @file cleanout.php Task to clean out 'dead' sessions, validations, registration image entires, etc
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-09-26 16:02:02 -0400 (Mon, 26 Sep 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9551 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,78 +17,67 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to clean out 'dead' sessions, validations, registration image entires, etc
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->caches =& ipsRegistry::cache()->fetchCaches();
|
||||
$this->cache = ipsRegistry::cache();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
* 1235503784
|
||||
* @access public
|
||||
* @return void
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
@@ -121,6 +103,58 @@ class task_item
|
||||
|
||||
$this->DB->delete( 'validating', 'lost_pass=1 AND entry_date < ' . $_cutoff );
|
||||
|
||||
/* Delete old saved content */
|
||||
$this->DB->delete( 'core_editor_autosave', 'eas_updated < ' . ( IPS_UNIX_TIME_NOW - 86400 ) );
|
||||
|
||||
/* Delete old cached content */
|
||||
$this->DB->delete( 'cache_simple', 'cache_time < ' . ( IPS_UNIX_TIME_NOW - 86400 ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Delete core_incoming_email_logs
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->DB->checkForTable('core_incoming_email_log') )
|
||||
{
|
||||
$this->DB->delete( 'core_incoming_email_log', 'log_time < ' . ( IPS_UNIX_TIME_NOW - 60 ) );
|
||||
}
|
||||
|
||||
/* Delete old inline messages (5 mins) */
|
||||
$this->DB->delete( 'core_inline_messages', 'inline_msg_date < ' . ( IPS_UNIX_TIME_NOW - 300 ) );
|
||||
|
||||
/* Update license key if needed */
|
||||
$licenseData = $this->cache->getCache( 'licenseData' );
|
||||
|
||||
if( ! $licenseData || ( $licenseData['key']['_expires'] != 9999999999 AND $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW ) )
|
||||
{
|
||||
/* We need a classFileManagement object */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$classFileManagement = new $classToLoad();
|
||||
|
||||
/* Query the api */
|
||||
$response = $classFileManagement->getFileContents("http://myipb.in/license.php?lk={$this->settings['ipb_reg_number']}&url={$this->settings['board_url']}&flush=1" );
|
||||
|
||||
/* Get License Data */
|
||||
$licenseData = json_decode( $response, true );
|
||||
|
||||
/* Copyright Removal? */
|
||||
if ( $licenseData['cr'] )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) );
|
||||
}
|
||||
elseif ( $this->settings['ips_cp_purchase'] )
|
||||
{
|
||||
IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) );
|
||||
}
|
||||
|
||||
/* Save to cache */
|
||||
$licenseData['_cached_date'] = time();
|
||||
$licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999;
|
||||
$licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999;
|
||||
|
||||
$this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) );
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
@@ -133,5 +167,4 @@ class task_item
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Prune back content cache
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file contentcache.php Task to prune the content cache (posts & signatures)
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: bfarber $
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* $LastChangedDate: 2011-03-18 21:17:06 -0400 (Fri, 18 Mar 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8131 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,69 +17,51 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to prune the content cache (posts & signatures)
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
|
||||
@@ -96,17 +71,17 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
/* Run it */
|
||||
$itemsRemoved = IPSContentCache::prune();
|
||||
|
||||
$this->class->appendTaskLog( $this->task, "Cleaned up content cache - " . $itemsRemoved . " items removed" );
|
||||
$log = ( $itemsRemoved === FALSE ) ? $this->lang->words['errorcleaningcontentcache'] : sprintf( $this->lang->words['contentcache_cleaned'], $itemsRemoved );
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $log );
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,6 @@
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Update 'dead' markers
|
||||
* Last Updated: $LastChangedDate: 2010-07-29 08:08:48 -0400 (Thu, 29 Jul 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file itemmarkers.php Task to prune dead item markers
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mmecham $
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 6711 $
|
||||
* $LastChangedDate: 2011-06-03 09:45:07 -0400 (Fri, 03 Jun 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8957 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,101 +17,90 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to prune dead item markers
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
/* INIT */
|
||||
if ( ! $this->registry->isClassLoaded( 'classItemMarking' ) )
|
||||
{
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/itemmarking/classItemMarking.php' );
|
||||
$this->registry->setClass( 'classItemMarking', new classItemMarking( $this->registry ) );
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/itemmarking/classItemMarking.php', 'classItemMarking' );
|
||||
$this->registry->setClass( 'classItemMarking', new $classToLoad( $this->registry ) );
|
||||
}
|
||||
|
||||
$time = time() - ( 86400 * 30 );
|
||||
$itemsRemoved = $this->registry->getClass('classItemMarking')->manualCleanUp( 50, 6 );
|
||||
|
||||
/* Remove 'deleted' items */
|
||||
$this->DB->delete( 'core_item_markers', 'item_is_deleted=1' );
|
||||
$c = $this->DB->getAffectedRows();
|
||||
|
||||
/* Now delete old markers - we use a separate query because there are separate indexes */
|
||||
$this->DB->delete( 'core_item_markers', 'item_last_saved < ' . $time );
|
||||
$c += $this->DB->getAffectedRows();
|
||||
|
||||
IPSDebug::addLogMessage( "$c item markers removed", 'markers_cleanout' );
|
||||
|
||||
$this->class->appendTaskLog( $this->task, "Cleaned up " . $itemsRemoved . " markers, removed " . $c . " unused rows" );
|
||||
|
||||
/* Log task */
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['itemmarkers_task_log'], $itemsRemoved, $c ) );
|
||||
|
||||
/* UNLOCK TASK */
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Prune old logs
|
||||
* Last Updated: $LastChangedDate: 2010-06-08 20:53:45 -0400 (Tue, 08 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 6485 $
|
||||
* @file logprune.php Task to prune old logs from the cache folder
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mmecham $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-04-19 11:20:55 -0400 (Tue, 19 Apr 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8383 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,69 +17,65 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to prune old logs from the cache folder
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Integer value (seconds) used to delete old records
|
||||
* By default 1 month: 2592000 (60*60*24*30)
|
||||
*
|
||||
* @var $deleteTime
|
||||
*/
|
||||
protected $deleteTime = 2592000;
|
||||
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
@@ -94,8 +83,7 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
@@ -103,84 +91,79 @@ class task_item
|
||||
|
||||
//-----------------------------------------
|
||||
// Spider Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['ipb_prune_spider'] )
|
||||
{
|
||||
$this->DB->delete( "spider_logs", "entry_date < " . (time() - (60*60*24*30)) );
|
||||
$this->DB->delete( "spider_logs", "entry_date < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Spam Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['ipb_prune_spam'] )
|
||||
{
|
||||
$this->DB->delete( "spam_service_log", "log_date < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Admin Login Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['prune_admin_login_logs'] )
|
||||
{
|
||||
$this->DB->delete( "admin_login_logs", "admin_time < " . (time() - (60*60*24*30)) );
|
||||
$this->DB->delete( "admin_login_logs", "admin_time < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Task Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['ipb_prune_task'] )
|
||||
{
|
||||
$this->DB->delete( "task_logs", "log_date < " . (time() - (60*60*24*30)) );
|
||||
$this->DB->delete( "task_logs", "log_date < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Admin Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this->settings['ipb_prune_admin'] )
|
||||
{
|
||||
$this->DB->delete( "admin_logs", "ctime < " . (time() - (60*60*24*30)) );
|
||||
$this->DB->delete( "admin_logs", "ctime < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Mod Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['ipb_prune_mod'] )
|
||||
{
|
||||
$this->DB->delete( "moderator_logs", "ctime < " . (time() - (60*60*24*30)) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Email Logs
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['ipb_prune_email'] )
|
||||
{
|
||||
$this->DB->delete( "email_logs", "email_date < " . (time() - (60*60*24*30)) );
|
||||
$this->DB->delete( "moderator_logs", "ctime < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Email Error Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['ipb_prune_emailerror'] )
|
||||
{
|
||||
$this->DB->delete( "mail_error_logs", "mlog_date < " . (time() - (60*60*24*30)) );
|
||||
$this->DB->delete( "mail_error_logs", "mlog_date < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Error Logs
|
||||
//-----------------------------------------
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['prune_error_logs'] )
|
||||
{
|
||||
$this->DB->delete( "error_logs", "log_date < " . (time() - (60*60*24*30)) );
|
||||
$this->DB->delete( "error_logs", "log_date < " . (time() - $this->deleteTime) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// SQL Error Logs
|
||||
// --Only prune older than 30 days
|
||||
//-----------------------------------------
|
||||
// SQL Logs
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->settings['ipb_prune_sql'] )
|
||||
{
|
||||
@@ -193,9 +176,9 @@ class task_item
|
||||
continue;
|
||||
}
|
||||
|
||||
if( preg_match( "#^sql_error_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename(), $matches ) )
|
||||
if( preg_match( "#^sql_(error|debug|upgrade)_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename(), $matches ) )
|
||||
{
|
||||
if( $file->getMTime() < (time() - (60*60*24*30)) )
|
||||
if( $file->getMTime() < (time() - $this->deleteTime) )
|
||||
{
|
||||
@unlink( $file->getPathname() );
|
||||
}
|
||||
@@ -216,5 +199,4 @@ class task_item
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Simple task to clean out sleeping mysql queries
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* @file mysqlcleanup.php Task to prune dead item markers
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,69 +17,57 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to prune dead item markers
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
@@ -94,13 +75,10 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// This is mysql only
|
||||
//-----------------------------------------
|
||||
@@ -124,11 +102,9 @@ class task_item
|
||||
// Make sure we're only killing stuff on our db
|
||||
//-----------------------------------------
|
||||
|
||||
if( $r['db'] == $this->settings['sql_database']
|
||||
AND $r['Command'] == 'Sleep'
|
||||
AND $r['Time'] > 60 )
|
||||
if( $r['db'] == $this->settings['sql_database'] AND $r['Command'] == 'Sleep' AND $r['Time'] > 60 )
|
||||
{
|
||||
$this->DB->return_die = true;
|
||||
$this->DB->return_die = true;
|
||||
$this->DB->query( "KILL {$r['Id']}" );
|
||||
|
||||
/* Log */
|
||||
@@ -136,12 +112,14 @@ class task_item
|
||||
}
|
||||
}
|
||||
|
||||
$this->DB->return_die = false;
|
||||
$this->DB->return_die = false;
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_mysqlcleanup'] );
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -150,5 +128,4 @@ class task_item
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Cleanup for uncleared OpenID caches
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* @file openidcleanup.php Task to cleanup uncleared OpenID caches
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,69 +17,53 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to cleanup uncleared OpenID caches
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
@@ -94,23 +71,12 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// This is mysql only
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strtolower( $this->settings['sql_driver'] ) != 'mysql' )
|
||||
{
|
||||
$this->class->unlockTask( $this->task );
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Clean out openid caches older than 24 hours
|
||||
// For whatever reason the OpenID libraries
|
||||
@@ -173,5 +139,4 @@ class task_item
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Optimizes database tables daily
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* @file optimize.php Task to optimize database tables daily
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,96 +17,76 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to optimize database tables daily
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**
|
||||
* Tables to optimize. Initially I was just going to run
|
||||
* optimize tables query against all tables, but Charles
|
||||
* prefers this static list of tables, and so it shall be.
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
* @var $charlesTables
|
||||
*/
|
||||
protected $charlesTables = array(
|
||||
'core_item_markers',
|
||||
'core_item_markers_storage',
|
||||
'inline_notifications',
|
||||
'cache_store',
|
||||
'content_cache_posts',
|
||||
);
|
||||
protected $charlesTables = array( 'core_item_markers',
|
||||
'core_item_markers_storage',
|
||||
'inline_notifications',
|
||||
'cache_store',
|
||||
'content_cache_posts',
|
||||
);
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
@@ -124,18 +97,8 @@ class task_item
|
||||
return;
|
||||
}
|
||||
|
||||
//$_tables = $this->DB->getTableNames();
|
||||
|
||||
//if( is_array($_tables) AND count($_tables) )
|
||||
//{
|
||||
// foreach( $_tables as $_table )
|
||||
// {
|
||||
// $this->DB->query( "OPTIMIZE TABLE {$_table}" );
|
||||
// $this->DB->query( "ANALYZE TABLE {$_table}" );
|
||||
// }
|
||||
//}
|
||||
|
||||
$_tables = $this->charlesTables;
|
||||
/* Get tables and optimize */
|
||||
$_tables = $this->charlesTables;
|
||||
|
||||
if( is_array($_tables) AND count($_tables) )
|
||||
{
|
||||
@@ -150,10 +113,12 @@ class task_item
|
||||
|
||||
ipsRegistry::dbFunctions()->prefix_changed = false;
|
||||
}
|
||||
|
||||
|
||||
/* Log to log table - modify but dont delete */
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task__optimizedtables'], count($_tables) ) );
|
||||
|
||||
|
||||
/* Unlock Task: DO NOT MODIFY! */
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Incoming Email Handler - POP3
|
||||
* Last Updated: $LastChangedDate: 2010-06-25 07:37:32 -0400 (Fri, 25 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2010 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @file pop3mail.php Task to handle incoming emails through POP3
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: mark $
|
||||
* @since 25th June 2010
|
||||
* @version $Rev: 6575 $
|
||||
* $LastChangedDate: 2011-08-23 10:24:47 -0400 (Tue, 23 Aug 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 9404 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,69 +17,54 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to handle incoming emails through POP3
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
@@ -94,17 +72,15 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
|
||||
//--------------------------------------
|
||||
// Init
|
||||
//--------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );
|
||||
require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );/*noLibHook*/
|
||||
$this->pop3 = new pop3_class;
|
||||
|
||||
$this->pop3->hostname = $this->settings['pop3_server'];
|
||||
@@ -147,6 +123,14 @@ class task_item
|
||||
|
||||
if ( !$messages )
|
||||
{
|
||||
$this->pop3->Close();
|
||||
|
||||
/* Log to log table - modify but dont delete */
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
|
||||
|
||||
/* Unlock Task: DO NOT MODIFY! */
|
||||
$this->class->unlockTask( $this->task );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -154,10 +138,10 @@ class task_item
|
||||
// Well get them then!
|
||||
//--------------------------------------
|
||||
|
||||
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );
|
||||
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );/*noLibHook*/
|
||||
|
||||
$result = $this->pop3->ListMessages( '', TRUE );
|
||||
|
||||
|
||||
if ( is_array( $result ) and !empty( $result ) )
|
||||
{
|
||||
foreach ( $result as $id => $messageID )
|
||||
@@ -171,7 +155,13 @@ class task_item
|
||||
}
|
||||
|
||||
$incomingEmail = new classIncomingEmail( $getMessage );
|
||||
$incomingEmail->route();
|
||||
if ( !$incomingEmail->ignore )
|
||||
{
|
||||
$incomingEmail->route();
|
||||
}
|
||||
|
||||
// And delete
|
||||
$this->pop3->DeleteMessage( $id );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,11 +171,10 @@ class task_item
|
||||
|
||||
$this->pop3->Close();
|
||||
|
||||
//-----------------------------------------
|
||||
// Cleanup
|
||||
//-----------------------------------------
|
||||
|
||||
/* Log to log table - modify but dont delete */
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
|
||||
|
||||
/* Unlock Task: DO NOT MODIFY! */
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
@@ -197,7 +186,7 @@ class task_item
|
||||
}
|
||||
|
||||
$response = $this->pop3->GetLine();
|
||||
if ( $response != "+OK message follows" )
|
||||
if ( substr( $response, 0, 3 ) != '+OK' )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -215,5 +204,4 @@ class task_item
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Rebuild stats
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
* @file rebuildstats.php Task to rebuild the board statistics
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: This is NULLED!
|
||||
* $Author: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -24,69 +17,54 @@ if ( ! defined( 'IN_IPB' ) )
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @class task_item
|
||||
* @brief Task to rebuild the board statistics
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
* @var $registry
|
||||
* @var $lang
|
||||
* @var $cache
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return void
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->registry = $registry;
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->cache = $this->registry->cache();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
@@ -94,8 +72,7 @@ class task_item
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user