Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WP Plugins
Cron-Control
Commits
b994eb26
Verified
Commit
b994eb26
authored
Dec 05, 2016
by
Erick Hitter
Browse files
Remove dependence on the VIP CLI class
parent
dc93d48e
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/wp-cli.php
View file @
b994eb26
<?php
namespace
Automattic\WP\Cron_Control
;
namespace
Automattic\WP\Cron_Control
\CLI
;
if
(
defined
(
'\WP_CLI'
)
&&
\
WP_CLI
)
{
re
quire
__DIR__
.
'/wp-cli/class-one-time-fixers.php'
;
if
(
!
defined
(
'\WP_CLI'
)
||
!
\
WP_CLI
)
{
re
turn
;
}
/**
* Clear all of the caches for memory management
*/
function
stop_the_insanity
()
{
global
$wpdb
,
$wp_object_cache
;
$wpdb
->
queries
=
array
();
// or define( 'WP_IMPORTING', true );
if
(
!
is_object
(
$wp_object_cache
)
)
return
;
$wp_object_cache
->
group_ops
=
array
();
$wp_object_cache
->
stats
=
array
();
$wp_object_cache
->
memcache_debug
=
array
();
$wp_object_cache
->
cache
=
array
();
if
(
is_callable
(
$wp_object_cache
,
'__remoteset'
)
)
{
$wp_object_cache
->
__remoteset
();
// important
}
}
/**
* Load commands
*/
require
__DIR__
.
'/wp-cli/class-one-time-fixers.php'
;
includes/wp-cli/class-one-time-fixers.php
View file @
b994eb26
...
...
@@ -2,7 +2,7 @@
namespace
Automattic\WP\Cron_Control\CLI
;
class
One_Time_Fixers
extends
\
WP
COM_VIP
_CLI_Command
{
class
One_Time_Fixers
extends
\
WP_CLI_Command
{
/**
* Remove corrupt Cron Control data resulting from initial plugin deployment
...
...
@@ -79,7 +79,7 @@ class One_Time_Fixers extends \WPCOM_VIP_CLI_Command {
// Some cleanup
unset
(
$items
);
$this
->
stop_the_insanity
();
stop_the_insanity
();
// Prepare for the next batch
$page
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment