Skip to content

Commit 37ba965

Browse files
committed
Add support for Afterburner 1.0
(cherry picked from commit cd54b8f)
1 parent 383ab27 commit 37ba965

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"humanmade/ludicrousdb": "~5.0.7",
4040
"humanmade/aws-ses-wp-mail": "~1.3.1",
4141
"monolog/monolog": "^2.11",
42-
"maxbanton/cwh": "^2.0"
42+
"maxbanton/cwh": "^2.0",
43+
"humanmade/afterburner-object-cache": "^1.0.0"
4344
},
4445
"extra": {
4546
"altis": {

inc/afterburner/class-qm-output-html.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function name() {
4343
*/
4444
public function output() {
4545
$stats = Afterburner\ObjectCache\getStats();
46+
$request_stats = Afterburner\ObjectCache\getRequestStats();
4647
?>
4748
<?php $this->before_tabular_output(); ?>
4849

@@ -72,8 +73,17 @@ public function output() {
7273
<td><code><?php echo esc_html( round( $stats->redis_total_time / 1000 ) ) ?>ms</code></td>
7374
</tr>
7475
<tr>
75-
<td><?php echo esc_html__( 'All stats for this PHP worker', 'altis' ); ?></td>
76-
<td><pre><?php echo esc_html( print_r( $stats, true ) ) // phpcs:ignore ?></pre></td>
76+
<td><?php echo esc_html__( 'All stats for this PHP worker', 'altis' ); ?></td>
77+
<td>
78+
<pre><?php echo esc_html( print_r( $stats, true ) ) // phpcs:ignore ?></pre>
79+
</td>
80+
</tr>
81+
<tr>
82+
<td><?php echo esc_html__( 'All stats for this request', 'altis' ); ?></td>
83+
<td>
84+
<pre><?php echo esc_html( print_r( $request_stats, true ) ) // phpcs:ignore ?></pre>
85+
</td>
86+
</tr>
7787
</tbody>
7888

7989
<?php

inc/namespace.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ function load_object_cache_afterburner() {
441441
require __DIR__ . '/alloptions_fix/namespace.php';
442442
Alloptions_Fix\bootstrap();
443443
// cache must be initted once it's included, else we'll get a fatal.
444+
445+
if ( class_exists( 'Afterburner\\LocalRedisCache' ) ) {
446+
require Altis\ROOT_DIR . '/vendor/humanmade/afterburner-object-cache/object-cache.php';
447+
}
444448
wp_cache_init();
445449
}
446450

0 commit comments

Comments
 (0)