Skip to content

Commit

Permalink
Use PHP_INT_MAX instead of -PHP_INT_MAX when attaching to shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Apr 28, 2016
1 parent c4328eb commit 9f096e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/includes/traits/Plugin/WcpPluginUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')}();
}
Expand Down
6 changes: 3 additions & 3 deletions src/includes/traits/Plugin/WcpUpdaterUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
}
}
Expand Down

0 comments on commit 9f096e3

Please sign in to comment.