Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Daily Cleanup Task
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 27 Aug 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\core\tasks;
|
||||
@@ -111,6 +110,17 @@ class _cleanup extends \IPS\Task
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_admin_login_logs', array( 'admin_time < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_log_adminlogin . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
/* ...and statistics */
|
||||
if( \IPS\Settings::i()->stats_online_users_prune )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_statistics', array( 'type=? AND time < ?', 'online_users', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->stats_online_users_prune . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
if( \IPS\Settings::i()->stats_keywords_prune )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_statistics', array( 'type=? AND time < ?', 'keyword', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->stats_keywords_prune . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
/* ...and geoip cache */
|
||||
\IPS\Db::i()->delete( 'core_geoip_cache', array( 'date < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'PT12H' ) )->getTimestamp() ) );
|
||||
@@ -120,6 +130,15 @@ class _cleanup extends \IPS\Task
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_api_logs', array( 'date < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->api_log_prune . 'D' ) )->getTimestamp() ) );
|
||||
}
|
||||
|
||||
/* ...and member history */
|
||||
if( \IPS\Settings::i()->prune_member_history )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_member_history', array( 'log_date < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . \IPS\Settings::i()->prune_member_history . 'D' ) )->getTimestamp(), 0 ) );
|
||||
}
|
||||
|
||||
/* ...and promote response logs */
|
||||
\IPS\Db::i()->delete( 'core_social_promote_content', array( 'response_date < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P6M' ) )->getTimestamp() ) );
|
||||
|
||||
/* Delete old notifications */
|
||||
if ( \IPS\Settings::i()->prune_notifications )
|
||||
@@ -201,6 +220,9 @@ class _cleanup extends \IPS\Task
|
||||
/* Delete old Google Authenticator code uses */
|
||||
\IPS\Db::i()->delete( 'core_googleauth_used_codes', array( 'time < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'PT1M' ) )->getTimestamp() ) );
|
||||
|
||||
/* Close open polls that need closing */
|
||||
\IPS\Db::i()->update( 'core_polls', array( 'poll_closed' => 1 ), array( 'poll_closed=? AND poll_close_date>? AND poll_close_date<?', 0, -1, time() ) );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user