-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathclass-cli.php
More file actions
40 lines (35 loc) · 843 Bytes
/
class-cli.php
File metadata and controls
40 lines (35 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Cloudinary CLI.
*
* @package Cloudinary
*/
namespace Cloudinary;
use Cloudinary\Traits\CLI_Trait;
use WP_CLI_Command;
// phpcs:disable WordPressVIPMinimum.Classes.RestrictedExtendClasses.wp_cli
/**
* CLI class.
*
* @since 2.5.1
*/
class CLI extends WP_CLI_Command {
// phpcs:enable
use CLI_Trait;
/**
* Workaround to prevent memory leaks from growing variables
*/
protected function stop_the_insanity() {
global $wpdb, $wp_object_cache;
$wpdb->queries = array();
if ( is_object( $wp_object_cache ) ) {
$wp_object_cache->group_ops = array();
$wp_object_cache->stats = array();
$wp_object_cache->memcache_debug = array();
$wp_object_cache->cache = array();
if ( method_exists( $wp_object_cache, '__remoteset' ) ) {
$wp_object_cache->__remoteset();
}
}
}
}