|
Server IP : 10.106.20.8 / Your IP : 216.73.216.148 Web Server : Apache System : Linux webm008.cluster106.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : sixiemesrc ( 611999) PHP Version : 8.0.30 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/sixiemesrc/new/wp-content/languages/../plugins/query-monitor/classes/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php declare(strict_types = 1);
/**
* Container for dispatchers.
*
* @package query-monitor
*/
/**
* @implements \IteratorAggregate<string, QM_Dispatcher>
*/
class QM_Dispatchers implements IteratorAggregate {
/**
* @var array<string, QM_Dispatcher>
*/
private $items = array();
/**
* @return ArrayIterator<string, QM_Dispatcher>
*/
#[\ReturnTypeWillChange]
public function getIterator() {
return new ArrayIterator( $this->items );
}
/**
* @param QM_Dispatcher $dispatcher
* @return void
*/
public static function add( QM_Dispatcher $dispatcher ) {
$dispatchers = self::init();
$dispatchers->items[ $dispatcher->id ] = $dispatcher;
}
/**
* @param string $id
* @return QM_Dispatcher|false
*/
public static function get( $id ) {
$dispatchers = self::init();
return $dispatchers->items[ $id ] ?? false;
}
/**
* @return void
*/
public static function cease() {
$dispatchers = self::init();
/** @var QM_Dispatcher $dispatcher */
foreach ( $dispatchers as $dispatcher ) {
$dispatcher->cease();
}
}
/**
* @return self
*/
public static function init() {
static $instance;
if ( ! $instance ) {
$instance = new QM_Dispatchers();
}
return $instance;
}
}