| Server IP : 172.173.179.141 / Your IP : 216.73.216.196 Web Server : Apache System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.2.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/bamagocr/wp-content/plugins/cloudflare/src/Router/ |
Upload File : |
<?php
namespace Cloudflare\APO\Router;
use Cloudflare\APO\API\Request;
use Cloudflare\APO\API\APIInterface;
use Cloudflare\APO\Integration\IntegrationInterface;
class RequestRouter
{
protected $integrationContext;
protected $routerList;
/**
* @param IntegrationInterface $integrationContext
*/
public function __construct(IntegrationInterface $integrationContext)
{
$this->integrationContext = $integrationContext;
$this->routerList = array();
}
/**
* @param APIInterface $client
* @param $routes
*/
public function addRouter(APIInterface $client, $routes)
{
$router = new DefaultRestAPIRouter($this->integrationContext, $client, $routes);
$this->routerList[$client->getAPIClientName()] = $router;
}
/**
* @return array
*/
public function getRouterList()
{
return $this->routerList;
}
/**
* @param $routerList
*/
public function setRouterList($routerList)
{
$this->routerList = $routerList;
}
/**
* @param Request $request
*
* @return bool
*/
public function route(Request $request)
{
foreach ($this->getRouterList() as $router) {
if ($router->getAPIClient()->shouldRouteRequest($request)) {
return $router->route($request);
}
}
return;
}
}