| Server IP : 93.127.179.84 / Your IP :
216.73.216.151 [
Web Server : LiteSpeed System : Linux nl-srv-web1124.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64 User : u964240598 ( 964240598) PHP Version : 8.4.19 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u964240598/public_html/jobs/wp-content/plugins/hostinger/includes/Admin/Jobs/ |
Upload File : |
<?php
namespace Hostinger\Admin\Jobs;
use Hostinger\Mcp\EventHandlerFactory;
use Hostinger\Mcp\Handlers\EventHandler;
use PHPUnit\Exception;
class NotifyMcpJob extends AbstractJob implements JobInterface {
public const JOB_NAME = 'notify_mcp';
private EventHandlerFactory $event_handler_factory;
public function __construct( ActionScheduler $action_scheduler, EventHandlerFactory $event_handler_factory ) {
$this->event_handler_factory = $event_handler_factory;
parent::__construct( $action_scheduler );
}
public function get_name(): string {
return self::JOB_NAME;
}
public function event_handler( string $event ): EventHandler {
return $this->event_handler_factory->get_handler( $event );
}
public function process_items( array $args = array() ): void {
$handler = $this->event_handler( $args['event'] );
$handler->send( $args );
}
public function schedule( array $args = array() ): void {
if ( $this->can_schedule( $args ) ) {
$this->action_scheduler->schedule_immediate( $this->get_process_item_hook(), array( $args ) );
}
}
public function can_schedule( $args = array() ): bool {
if ( ! parent::can_schedule( $args ) ) {
return false;
}
try {
$handler = $this->event_handler( $args['event'] );
return $handler->can_send( $args );
} catch ( Exception $e ) {
return false;
}
}
}
Anon7 - 2022
AnonSec Team
