From 9f096e380a401cb8528b9463ae2f6c064252f889 Mon Sep 17 00:00:00 2001 From: Raam Dev Date: Thu, 28 Apr 2016 18:43:30 -0400 Subject: [PATCH] Use PHP_INT_MAX instead of -PHP_INT_MAX when attaching to `shutdown` See websharks/comet-cache#740 --- src/includes/traits/Plugin/WcpPluginUtils.php | 2 +- src/includes/traits/Plugin/WcpUpdaterUtils.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/includes/traits/Plugin/WcpPluginUtils.php b/src/includes/traits/Plugin/WcpPluginUtils.php index bc6ad21d..4a374fe0 100644 --- a/src/includes/traits/Plugin/WcpPluginUtils.php +++ b/src/includes/traits/Plugin/WcpPluginUtils.php @@ -26,7 +26,7 @@ public function autoClearOnPluginActivationDeactivation($plugin, $network_wide = return 0; // Nothing to do here. } - add_action('shutdown', [$this, 'wipeOpcacheByForce'], -PHP_INT_MAX); + add_action('shutdown', [$this, 'wipeOpcacheByForce'], PHP_INT_MAX); return $this->{($network_wide ? 'autoWipeCache' : 'autoClearCache')}(); } diff --git a/src/includes/traits/Plugin/WcpUpdaterUtils.php b/src/includes/traits/Plugin/WcpUpdaterUtils.php index 81899db8..14c2d14c 100644 --- a/src/includes/traits/Plugin/WcpUpdaterUtils.php +++ b/src/includes/traits/Plugin/WcpUpdaterUtils.php @@ -51,7 +51,7 @@ public function autoClearOnUpgraderProcessComplete(\WP_Upgrader $upgrader_instan } if ($upgrading_active_plugin) { $counter += $this->autoClearCache(); - add_action('shutdown', [$this, 'wipeOpcacheByForce'], -PHP_INT_MAX); + add_action('shutdown', [$this, 'wipeOpcacheByForce'], PHP_INT_MAX); } break; // Break switch. @@ -92,14 +92,14 @@ public function autoClearOnUpgraderProcessComplete(\WP_Upgrader $upgrader_instan if ($upgrading_active_theme || $upgrading_active_parent_theme) { $counter += $this->autoClearCache(); - add_action('shutdown', [$this, 'wipeOpcacheByForce'], -PHP_INT_MAX); + add_action('shutdown', [$this, 'wipeOpcacheByForce'], PHP_INT_MAX); } break; // Break switch. case 'core': // Core upgrade. default: // Or any other sort of upgrade. $counter += $this->autoClearCache(); - add_action('shutdown', [$this, 'wipeOpcacheByForce'], -PHP_INT_MAX); + add_action('shutdown', [$this, 'wipeOpcacheByForce'], PHP_INT_MAX); break; // Break switch. } }