← All changes
|
vendor/woocommerce/action-scheduler/classes/ActionScheduler_DataController.php
+20
-6
1.5.0
→
1.7.7
View file →
| @@ -17,12 +17,12 @@ | ||
| 17 | 17 | /** Action data store class name. */ |
| 18 | 18 | const DATASTORE_CLASS = 'ActionScheduler_DBStore'; |
| 19 | 19 | |
| 20 | 20 | /** Logger data store class name. */ |
| 21 | - const LOGGER_CLASS = 'ActionScheduler_DBLogger'; | |
| 21 | + const LOGGER_CLASS = 'ActionScheduler_DBLogger'; | |
| 22 | 22 | |
| 23 | 23 | /** Migration status option name. */ |
| 24 | - const STATUS_FLAG = 'action_scheduler_migration_status'; | |
| 24 | + const STATUS_FLAG = 'action_scheduler_migration_status'; | |
| 25 | 25 | |
| 26 | 26 | /** Migration status option value. */ |
| 27 | 27 | const STATUS_COMPLETE = 'complete'; |
| 28 | 28 | |
| @@ -28,15 +28,27 @@ | ||
| 28 | 28 | |
| 29 | 29 | /** Migration minimum required PHP version. */ |
| 30 | 30 | const MIN_PHP_VERSION = '5.5'; |
| 31 | 31 | |
| 32 | - /** @var ActionScheduler_DataController */ | |
| 32 | + /** | |
| 33 | + * Instance. | |
| 34 | + * | |
| 35 | + * @var ActionScheduler_DataController | |
| 36 | + */ | |
| 33 | 37 | private static $instance; |
| 34 | 38 | |
| 35 | - /** @var int */ | |
| 39 | + /** | |
| 40 | + * Sleep time in seconds. | |
| 41 | + * | |
| 42 | + * @var int | |
| 43 | + */ | |
| 36 | 44 | private static $sleep_time = 0; |
| 37 | 45 | |
| 38 | - /** @var int */ | |
| 46 | + /** | |
| 47 | + * Tick count required for freeing memory. | |
| 48 | + * | |
| 49 | + * @var int | |
| 50 | + */ | |
| 39 | 51 | private static $free_ticks = 50; |
| 40 | 52 | |
| 41 | 53 | /** |
| 42 | 54 | * Get a flag indicating whether the migration environment dependencies are met. |
| @@ -136,8 +148,10 @@ | ||
| 136 | 148 | |
| 137 | 149 | \WP_CLI::warning( __( 'Attempting to reduce used memory...', 'action-scheduler' ) ); |
| 138 | 150 | |
| 139 | 151 | /** |
| 152 | + * Globals. | |
| 153 | + * | |
| 140 | 154 | * @var $wpdb \wpdb |
| 141 | 155 | * @var $wp_object_cache \WP_Object_Cache |
| 142 | 156 | */ |
| 143 | 157 | global $wpdb, $wp_object_cache; |
| @@ -153,9 +167,9 @@ | ||
| 153 | 167 | $wp_object_cache->memcache_debug = array(); |
| 154 | 168 | $wp_object_cache->cache = array(); |
| 155 | 169 | |
| 156 | 170 | if ( is_callable( array( $wp_object_cache, '__remoteset' ) ) ) { |
| 157 | - call_user_func( array( $wp_object_cache, '__remoteset' ) ); // important | |
| 171 | + call_user_func( array( $wp_object_cache, '__remoteset' ) ); // important! | |
| 158 | 172 | } |
| 159 | 173 | } |
| 160 | 174 | |
| 161 | 175 | /** |