One Hat Cyber Team
Your IP:
216.73.216.102
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
home
/
fluxyjvi
/
public_html
/
assets
/
images
/
Edit File:
Network.tar
Number/Callback.php 0000644 00000004744 15107340732 0010214 0 ustar 00 <?php /** * Vonage Client Library for PHP * * @copyright Copyright (c) 2016-2022 Vonage, Inc. (http://vonage.com) * @license https://github.com/Vonage/vonage-php-sdk-core/blob/master/LICENSE.txt Apache License 2.0 */ declare(strict_types=1); namespace Vonage\Network\Number; use BadMethodCallException; use Vonage\Client\Callback\Callback as BaseCallback; use function substr; /** * @method null|string getType() * @method bool hasType() * @method null|string getNetwork() * @method bool hasNetwork() * @method null|string getNetworkName() * @method bool hasNetworkName() * @method null|string getValid() * @method bool hasValid() * @method null|string getPorted() * @method bool hasPorted() * @method null|string getReachable() * @method bool hasReachable() * @method null|string getRoaming() * @method bool hasRoaming() * @method null|string getRoamingCountry() * @method bool hasRoamingCountry() * @method null|string getRoamingNetwork() * @method bool hasRoamingNetwork() */ class Callback extends BaseCallback { protected $expected = ['request_id', 'callback_part', 'callback_total_parts', 'number', 'status']; protected $optional = [ 'Type' => 'number_type', 'Network' => 'carrier_network_code', 'NetworkName' => 'carrier_network_name', 'Valid' => 'valid', 'Ported' => 'ported', 'Reachable' => 'reachable', 'Roaming' => 'roaming', 'RoamingCountry' => 'roaming_country_code', 'RoamingNetwork' => 'roaming_network_code', ]; public function getId() { return $this->data['request_id']; } public function getCallbackTotal() { return $this->data['callback_total_parts']; } public function getCallbackIndex() { return $this->data['callback_part']; } public function getNumber() { return $this->data['number']; } /** * @param $name * @param $args */ public function __call($name, $args) { $type = substr($name, 0, 3); $property = substr($name, 3); if (!isset($this->optional[$property])) { throw new BadMethodCallException('property does not exist: ' . $property); } $property = $this->optional[$property]; return match ($type) { 'get' => $this->data[$property] ?? null, 'has' => isset($this->data[$property]), default => throw new BadMethodCallException('method does not exist: ' . $name), }; } } Number/Request.php 0000644 00000003406 15107340732 0010142 0 ustar 00 <?php /** * Vonage Client Library for PHP * * @copyright Copyright (c) 2016-2022 Vonage, Inc. (http://vonage.com) * @license https://github.com/Vonage/vonage-php-sdk-core/blob/master/LICENSE.txt Apache License 2.0 */ declare(strict_types=1); namespace Vonage\Network\Number; use Vonage\Client\Request\AbstractRequest; use Vonage\Client\Request\WrapResponseInterface; use Vonage\Client\Response\Error; use Vonage\Client\Response\ResponseInterface; use function implode; class Request extends AbstractRequest implements WrapResponseInterface { public const FEATURE_TYPE = 'type'; public const FEATURE_VALID = 'valid'; public const FEATURE_REACHABLE = 'reachable'; public const FEATURE_CARRIER = 'carrier'; public const FEATURE_PORTED = 'ported'; public const FEATURE_ROAMING = 'roaming'; public const FEATURE_SUBSCRIBER = 'subscriber'; /** * @var array */ protected $params; /** * @param $number * @param $callback */ public function __construct($number, $callback, array $features = [], $timeout = null, $method = null, $ref = null) { $this->params['number'] = $number; $this->params['callback'] = $callback; $this->params['callback_timeout'] = $timeout; $this->params['callback_method'] = $method; $this->params['client_ref'] = $ref; if (!empty($features)) { $this->params['features'] = implode(',', $features); } } public function getURI(): string { return '/ni/json'; } public function wrapResponse(ResponseInterface $response): ResponseInterface { if ($response->isError()) { return new Error($response->getData()); } return new Response($response->getData()); } } Number/Response.php 0000644 00000005437 15107340733 0010317 0 ustar 00 <?php /** * Vonage Client Library for PHP * * @copyright Copyright (c) 2016-2022 Vonage, Inc. (http://vonage.com) * @license https://github.com/Vonage/vonage-php-sdk-core/blob/master/LICENSE.txt Apache License 2.0 */ declare(strict_types=1); namespace Vonage\Network\Number; use BadMethodCallException; use InvalidArgumentException; use Vonage\Client\Response\Response as BaseResponse; use function array_merge; use function count; class Response extends BaseResponse { protected $callbacks = []; public function __construct(array $data, array $callbacks = []) { //add expected keys $this->expected = array_merge($this->expected, [ 'request_id', 'number', 'request_price', 'remaining_balance', 'callback_total_parts' ]); parent::__construct($data); foreach ($callbacks as $callback) { if (!($callback instanceof Callback)) { throw new InvalidArgumentException('callback must be of type: Vonage\Network\Number\Callback'); } if ($callback->getId() !== $this->getId()) { throw new InvalidArgumentException('callback id must match request id'); } } $this->callbacks = $callbacks; } public function getCallbackTotal() { return $this->data['callback_total_parts']; } public function isComplete(): bool { return count($this->callbacks) === $this->getCallbackTotal(); } public function getPrice() { return $this->data['request_price']; } public function getBalance() { return $this->data['remaining_balance']; } public function getNumber() { return $this->data['number']; } public function getId() { return $this->data['request_id']; } public function getStatus() { return $this->data['status']; } /** * @param $name * @param $args * * @todo This looks somewhat illogical */ public function __call($name, $args) { if (empty($this->callbacks)) { throw new BadMethodCallException('can not check for response data without callback data'); } foreach ($this->callbacks as $callback) { if ($last = $callback->$name()) { return $last; } } /** @noinspection PhpUndefinedVariableInspection */ return $last; } public function getCallbacks(): array { return $this->callbacks; } public static function addCallback(Response $response, callable $callback): Response { $callbacks = $response->getCallbacks(); $callbacks[] = $callback; return new static($response->getData(), $callbacks); } }
Simpan