![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/www/wp-content/plugins/wp-rocket/inc/Engine/Optimization/Buffer/ |
<?php declare(strict_types=1); namespace WP_Rocket\Engine\Optimization\Buffer; use WP_Rocket\Event_Management\Subscriber_Interface; /** * Event subscriber to buffer and process a page content. * * @since 3.3 */ class Subscriber implements Subscriber_Interface { /** * Optimization instance * * @var Optimization */ private $optimizer; /** * Constructor * * @param Optimization $optimizer Optimization instance. */ public function __construct( Optimization $optimizer ) { $this->optimizer = $optimizer; } /** * {@inheritdoc} */ public static function get_subscribed_events() { return [ 'template_redirect' => [ 'start_content_process', 2 ], ]; } /** * Start buffering the page content and apply optimizations if we can. * * @since 3.3 */ public function start_content_process() { return $this->optimizer->maybe_init_process(); } }