@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phpmyadmin-ubuntu-m-2vcpu-16gb-blr1-01 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Current Path :
/
var
/
www
/
html
/
-wp-content
/
plugins
/
query-monitor
/
classes
/
Path :
Upload File :
New :
File
Dir
/var/www/html/-wp-content/plugins/query-monitor/classes/Collectors.php
<?php /** * Container for data collectors. * * @package query-monitor */ if ( ! class_exists( 'QM_Collectors' ) ) { class QM_Collectors implements IteratorAggregate { private $items = array(); private $processed = false; public function getIterator() { return new ArrayIterator( $this->items ); } public static function add( QM_Collector $collector ) { $collectors = self::init(); $collectors->items[ $collector->id ] = $collector; } /** * Fetches a collector instance. * * @param string $id The collector ID. * @return QM_Collector|null The collector object. */ public static function get( $id ) { $collectors = self::init(); if ( isset( $collectors->items[ $id ] ) ) { return $collectors->items[ $id ]; } return null; } public static function init() { static $instance; if ( ! $instance ) { $instance = new QM_Collectors(); } return $instance; } public function process() { if ( $this->processed ) { return; } foreach ( $this as $collector ) { $collector->tear_down(); $timer = new QM_Timer(); $timer->start(); $collector->process(); $collector->process_concerns(); $collector->set_timer( $timer->stop() ); } foreach ( $this as $collector ) { $collector->post_process(); } $this->processed = true; } } }