mirror of
https://github.com/felixfoertsch/wordpress-dev-env.git
synced 2026-04-18 23:38:37 +02:00
Initial commit
This commit is contained in:
24
wordpress_plugins/query-monitor/output/Headers.php
Normal file
24
wordpress_plugins/query-monitor/output/Headers.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Abstract output class for HTTP headers.
|
||||
*
|
||||
* @package query-monitor
|
||||
*/
|
||||
|
||||
abstract class QM_Output_Headers extends QM_Output {
|
||||
|
||||
public function output() {
|
||||
|
||||
$id = $this->collector->id;
|
||||
|
||||
foreach ( $this->get_output() as $key => $value ) {
|
||||
if ( is_scalar( $value ) ) {
|
||||
header( sprintf( 'X-QM-%s-%s: %s', $id, $key, $value ) );
|
||||
} else {
|
||||
header( sprintf( 'X-QM-%s-%s: %s', $id, $key, json_encode( $value ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user