One Hat Cyber Team
Your IP:
216.73.216.211
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 :
~
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
cwd
/
Edit File:
Numbers.tar
Filter/AvailableNumbers.php 0000644 00000014605 15111720236 0011722 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\Numbers\Filter; use InvalidArgumentException; use Vonage\Client\Exception\Request; use Vonage\Entity\Filter\FilterInterface; use Vonage\Numbers\Number; use function array_key_exists; use function implode; use function is_array; use function strlen; class AvailableNumbers implements FilterInterface { public const SEARCH_PATTERN_BEGIN = 0; public const SEARCH_PATTERN_CONTAINS = 1; public const SEARCH_PATTERN_ENDS = 2; public static array $possibleParameters = [ 'country' => 'string', 'pattern' => 'string', 'search_pattern' => 'integer', 'size' => 'integer', 'index' => 'integer', 'has_application' => 'boolean', 'application_id' => 'string', 'features' => 'string', 'type' => 'string', ]; /** * @var string */ protected $country; /** * @var string */ protected $features; /** * @var int */ protected $pageIndex = 1; /** * @var int */ protected $pageSize = 10; /** * @var string */ protected $pattern; /** * @var int */ protected $searchPattern = 0; /** * @var string */ protected $type; public function __construct(array $filter = []) { foreach ($filter as $key => $value) { if (!array_key_exists($key, self::$possibleParameters)) { throw new Request("Unknown option: '" . $key . "'"); } switch (self::$possibleParameters[$key]) { case 'boolean': $value = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); if (is_null($value)) { throw new Request("Invalid value: '" . $key . "' must be a boolean value"); } $value = $value ? "true" : "false"; break; case 'integer': $value = filter_var($value, FILTER_VALIDATE_INT); if ($value === false) { throw new Request("Invalid value: '" . $key . "' must be an integer"); } break; default: // No-op, take the value whatever it is break; } } if (array_key_exists('country', $filter)) { $this->setCountry($filter['country']); } if (array_key_exists('size', $filter)) { $this->setPageSize((int)$filter['size']); } if (array_key_exists('index', $filter)) { $this->setPageIndex((int)$filter['index']); } if (array_key_exists('pattern', $filter)) { $this->setPattern($filter['pattern']); if (array_key_exists('search_pattern', $filter)) { $this->setSearchPattern((int)$filter['search_pattern']); } } if (array_key_exists('type', $filter)) { $this->setType($filter['type']); } if (array_key_exists('features', $filter)) { // Handle the old format where we asked for an array if (is_array($filter['features'])) { $filter['features'] = implode(',', $filter['features']); } $this->setFeatures($filter['features']); } } /** * @return int[] */ public function getQuery(): array { $data = [ 'size' => $this->getPageSize(), 'index' => $this->getPageIndex(), ]; if ($this->getCountry()) { $data['country'] = $this->getCountry(); } if ($this->getPattern()) { $data['search_pattern'] = $this->getSearchPattern(); $data['pattern'] = $this->getPattern(); } if ($this->getType()) { $data['type'] = $this->getType(); } if ($this->getFeatures()) { $data['features'] = $this->getFeatures(); } return $data; } public function getCountry(): ?string { return $this->country; } protected function setCountry(string $country): void { if (strlen($country) !== 2) { throw new InvalidArgumentException("Country must be in ISO 3166-1 Alpha-2 Format"); } $this->country = $country; } public function getFeatures(): ?string { return $this->features; } /** * @return $this */ public function setFeatures(string $features): self { $this->features = $features; return $this; } public function getPageIndex(): int { return $this->pageIndex; } /** * @return $this */ public function setPageIndex(int $pageIndex): self { $this->pageIndex = $pageIndex; return $this; } public function getPattern(): ?string { return $this->pattern; } /** * @return $this */ public function setPattern(string $pattern): self { $this->pattern = $pattern; return $this; } public function getSearchPattern(): int { return $this->searchPattern; } /** * @return $this */ public function setSearchPattern(int $searchPattern): self { $this->searchPattern = $searchPattern; return $this; } public function getType(): ?string { return $this->type; } /** * @return $this */ public function setType(string $type): self { // Workaround for code snippets if (empty($type)) { return $this; } $valid = [ Number::TYPE_FIXED, Number::TYPE_MOBILE, Number::TYPE_TOLLFREE, ]; if (!in_array($type, $valid)) { throw new InvalidArgumentException('Invalid type of number'); } $this->type = $type; return $this; } public function getPageSize(): int { return $this->pageSize; } /** * @return $this */ public function setPageSize(int $pageSize): self { $this->pageSize = $pageSize; return $this; } } Filter/OwnedNumbers.php 0000644 00000014045 15111720236 0011114 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\Numbers\Filter; use InvalidArgumentException; use Vonage\Client\Exception\Request; use Vonage\Entity\Filter\FilterInterface; use function array_key_exists; use function filter_var; use function is_null; use function strlen; class OwnedNumbers implements FilterInterface { public const SEARCH_PATTERN_BEGIN = 0; public const SEARCH_PATTERN_CONTAINS = 1; public const SEARCH_PATTERN_ENDS = 2; public static array $possibleParameters = [ 'country' => 'string', 'pattern' => 'string', 'search_pattern' => 'integer', 'size' => 'integer', 'index' => 'integer', 'has_application' => 'boolean', 'application_id' => 'string', 'features' => 'string' ]; /** * @var string */ protected $applicationId; /** * @var string */ protected $country; /** * @var bool */ protected $hasApplication; /** * @var int */ protected $pageIndex = 1; /** * @var string */ protected $pattern; /** * @var int */ protected $searchPattern = 0; protected int $pageSize = 10; public function __construct(array $filter = []) { foreach ($filter as $key => $value) { if (!array_key_exists($key, self::$possibleParameters)) { throw new Request("Unknown option: '" . $key . "'"); } switch (self::$possibleParameters[$key]) { case 'boolean': $value = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); if (is_null($value)) { throw new Request("Invalid value: '" . $key . "' must be a boolean value"); } $value = $value ? "true" : "false"; break; case 'integer': $value = filter_var($value, FILTER_VALIDATE_INT); if ($value === false) { throw new Request("Invalid value: '" . $key . "' must be an integer"); } break; default: // No-op, take the value whatever it is break; } } if (array_key_exists('country', $filter)) { $this->setCountry($filter['country']); } if (array_key_exists('size', $filter)) { $this->setPageSize((int)$filter['size']); } if (array_key_exists('index', $filter)) { $this->setPageIndex((int)$filter['index']); } if (array_key_exists('pattern', $filter)) { $this->setPattern($filter['pattern']); if (array_key_exists('search_pattern', $filter)) { $this->setSearchPattern($filter['search_pattern']); } } if (array_key_exists('application_id', $filter)) { $this->setApplicationId($filter['application_id']); } if (array_key_exists('has_application', $filter)) { $this->setHasApplication(filter_var($filter['has_application'], FILTER_VALIDATE_BOOLEAN)); } } /** * @return int[] */ public function getQuery(): array { $data = [ 'size' => $this->getPageSize(), 'index' => $this->getPageIndex(), ]; if ($this->getCountry()) { $data['country'] = $this->getCountry(); } if ($this->getPattern()) { $data['search_pattern'] = $this->getSearchPattern(); $data['pattern'] = $this->getPattern(); } if ($this->getApplicationId()) { $data['application_id'] = $this->getApplicationId(); } if (!is_null($this->getHasApplication())) { // The API requires a string $data['has_application'] = $this->getHasApplication() ? 'true' : 'false'; } return $data; } public function getCountry(): ?string { return $this->country; } protected function setCountry(string $country): void { if (strlen($country) !== 2) { throw new InvalidArgumentException("Country must be in ISO 3166-1 Alpha-2 Format"); } $this->country = $country; } public function getPageIndex(): int { return $this->pageIndex; } /** * @return $this */ public function setPageIndex(int $pageIndex): self { $this->pageIndex = $pageIndex; return $this; } public function getPattern(): ?string { return $this->pattern; } /** * @return $this */ public function setPattern(string $pattern): self { $this->pattern = $pattern; return $this; } public function getSearchPattern(): int { return $this->searchPattern; } /** * @return $this */ public function setSearchPattern(int $searchPattern): self { $this->searchPattern = $searchPattern; return $this; } public function getPageSize(): int { return $this->pageSize; } /** * @return $this */ public function setPageSize(int $pageSize): self { $this->pageSize = $pageSize; return $this; } public function getApplicationId(): ?string { return $this->applicationId; } /** * @return $this */ public function setApplicationId(string $applicationId): self { $this->applicationId = $applicationId; return $this; } public function getHasApplication(): ?bool { return $this->hasApplication; } /** * @return $this */ public function setHasApplication(bool $hasApplication): self { $this->hasApplication = $hasApplication; return $this; } } ClientFactory.php 0000644 00000001412 15111720236 0010017 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\Numbers; use Psr\Container\ContainerInterface; use Vonage\Client\APIResource; use Vonage\Client\Credentials\Handler\BasicHandler; class ClientFactory { public function __invoke(ContainerInterface $container): Client { /** @var APIResource $api */ $api = $container->make(APIResource::class); $api ->setBaseUrl($api->getClient()->getRestUrl()) ->setIsHAL(false) ->setAuthHandler(new BasicHandler()); return new Client($api); } } Client.php 0000644 00000017532 15111720236 0006501 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\Numbers; use Psr\Http\Client\ClientExceptionInterface; use Vonage\Client\APIClient; use Vonage\Client\APIResource; use Vonage\Client\Exception as ClientException; use Vonage\Client\Exception\Exception; use Vonage\Client\Exception\Request; use Vonage\Client\Exception\Server; use Vonage\Client\Exception\ThrottleException; use Vonage\Entity\Filter\FilterInterface; use Vonage\Entity\IterableAPICollection; use Vonage\Numbers\Filter\AvailableNumbers; use Vonage\Numbers\Filter\OwnedNumbers; use function count; use function is_null; use function sleep; use function trigger_error; class Client implements APIClient { public function __construct(protected ?APIResource $api = null) { } public function getApiResource(): APIResource { return $this->api; } /** * @param Number $number * @param string|null $id * * @return Number * @throws ClientExceptionInterface * @throws Exception * @throws Request * @throws Server */ public function update(Number $number, ?string $id = null): Number { if (!is_null($id)) { $update = $this->get($id); } $body = $number->toArray(); if (!isset($update) && !isset($body['country'])) { $data = $this->get($number->getId()); $body['msisdn'] = $data->getId(); $body['country'] = $data->getCountry(); } if (isset($update)) { $body['msisdn'] = $update->getId(); $body['country'] = $update->getCountry(); } unset($body['features'], $body['type']); $api = $this->getApiResource(); $api->submit($body, '/number/update'); if (isset($update)) { try { return $this->get($number->getId()); } catch (ThrottleException) { sleep(1); // This API is 1 request per second :/ return $this->get($number->getId()); } } try { return $this->get($number->getId()); } catch (ThrottleException) { sleep(1); // This API is 1 request per second :/ return $this->get($number->getId()); } } /** * Returns a number * * @param string $number Number to fetch, deprecating passing a `Number` object * * @return Number * @throws ClientExceptionInterface * @throws ClientException\Exception * @throws ClientException\Request * @throws ClientException\Server */ public function get(string $number): Number { $items = $this->searchOwned($number); // This is legacy behaviour, so we need to keep it even though // it isn't technically the correct message if (count($items) !== 1) { throw new ClientException\Request('number not found', 404); } return $items[0]; } /** * Returns a set of numbers for the specified country * * @param string $country The two character country code in ISO 3166-1 alpha-2 format * @param FilterInterface $options Additional options, see https://developer.nexmo.com/api/numbers#getAvailableNumbers * * @return array * @throws ClientExceptionInterface * @throws ClientException\Exception * @throws ClientException\Request * @throws ClientException\Server */ public function searchAvailable(string $country, FilterInterface $options = null): array { if (is_null($options)) { $options = new AvailableNumbers([ 'country' => $country ]); } $api = $this->getApiResource(); $api->setCollectionName('numbers'); $response = $api->search( new AvailableNumbers($options->getQuery() + ['country' => $country]), '/number/search' ); $response->setHydrator(new Hydrator()); $response->setAutoAdvance(false); // The search results on this can be quite large return $this->handleNumberSearchResult($response, null); } /** * Returns a set of numbers for the specified country * * @param null $number * @param FilterInterface|null $options * * @return array * @throws ClientExceptionInterface * @throws ClientException\Exception * @throws ClientException\Request * @throws ClientException\Server */ public function searchOwned($number = null, FilterInterface $options = null): array { if ($number !== null) { if ($options !== null) { $options->setPattern($number); } else { $options = new OwnedNumbers([ 'pattern' => $number ]); } } $api = $this->getApiResource(); $api->setCollectionName('numbers'); $response = $api->search($options, '/account/numbers'); $response->setHydrator(new Hydrator()); $response->setAutoAdvance(false); // The search results on this can be quite large return $this->handleNumberSearchResult($response, $number); } /** * @param $number deprecated * * @throws ClientException\Exception * @throws ClientException\Request * @throws ClientException\Server * @throws ClientExceptionInterface */ private function handleNumberSearchResult(IterableAPICollection $response, $number = null): array { // We're going to return a list of numbers $numbers = []; // Legacy - If the user passed in a number object, populate that object // @deprecated This will eventually return a new clean object if ($number instanceof Number && count($response) === 1) { $number->fromArray($response->current()->toArray()); $numbers[] = $number; } else { foreach ($response as $rawNumber) { $numbers[] = $rawNumber; } } return $numbers; } /** * @param $number * * @throws ClientExceptionInterface * @throws ClientException\Exception */ public function purchase($number, ?string $country = null): void { if (!$country) { throw new ClientException\Exception( "You must supply a country in addition to a number to purchase a number" ); } if ($number instanceof Number) { trigger_error( 'Passing a Number object to Vonage\Number\Client::purchase() is being deprecated, ' . 'please pass a string MSISDN instead', E_USER_DEPRECATED ); $body = [ 'msisdn' => $number->getMsisdn(), 'country' => $number->getCountry() ]; // Evil else that will be removed in the next major version. } else { $body = [ 'msisdn' => $number, 'country' => $country ]; } $api = $this->getApiResource(); $api->setBaseUri('/number/buy'); $api->submit($body); } /** * @param string $number * @param string|null $country * * @throws ClientExceptionInterface * @throws ClientException\Exception * @throws ClientException\Request * @throws ClientException\Server */ public function cancel(string $number, ?string $country = null): void { $number = $this->get($number); $body = [ 'msisdn' => $number->getMsisdn(), 'country' => $number->getCountry() ]; $api = $this->getApiResource(); $api->setBaseUri('/number/cancel'); $api->submit($body); } } Number.php 0000644 00000016165 15111720236 0006514 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\Numbers; use InvalidArgumentException; use RuntimeException; use Vonage\Application\Application; use Vonage\Entity\EntityInterface; use Vonage\Entity\Hydrator\ArrayHydrateInterface; use Vonage\Entity\JsonResponseTrait; use Vonage\Entity\JsonSerializableInterface; use Vonage\Entity\JsonSerializableTrait; use Vonage\Entity\JsonUnserializableInterface; use Vonage\Entity\NoRequestResponseTrait; use function get_class; use function in_array; use function is_null; use function json_decode; use function json_last_error; use function preg_match; use function stripos; use function strpos; use function trigger_error; class Number implements EntityInterface, JsonSerializableInterface, JsonUnserializableInterface, ArrayHydrateInterface, \Stringable { use JsonSerializableTrait; use NoRequestResponseTrait; use JsonResponseTrait; public const TYPE_MOBILE = 'mobile-lvn'; public const TYPE_FIXED = 'landline'; public const TYPE_TOLLFREE = 'landline-toll-free'; public const FEATURE_VOICE = 'VOICE'; public const FEATURE_SMS = 'SMS'; public const FEATURE_MMS = 'MMS'; public const FEATURE_SMS_VOICE = 'SMS,VOICE'; public const FEATURE_SMS_MMS = 'SMS,MMS'; public const FEATURE_VOICE_MMS = 'VOICE,MMS'; public const FEATURE_ALL = 'SMS,MMS,VOICE'; public const WEBHOOK_MESSAGE = 'moHttpUrl'; public const WEBHOOK_VOICE_STATUS = 'voiceStatusCallback'; public const ENDPOINT_SIP = 'sip'; public const ENDPOINT_TEL = 'tel'; public const ENDPOINT_VXML = 'vxml'; public const ENDPOINT_APP = 'app'; /** * @var array */ protected $data = []; public function __construct($number = null, $country = null) { $this->data['msisdn'] = $number; $this->data['country'] = $country; } public function getId() { return $this->fromData('msisdn'); } public function getMsisdn() { return $this->getId(); } public function getNumber() { return $this->getId(); } public function getCountry() { return $this->fromData('country'); } public function getType() { return $this->fromData('type'); } public function getCost() { return $this->fromData('cost'); } /** * @param $feature */ public function hasFeature($feature): bool { if (!isset($this->data['features'])) { return false; } return in_array($feature, $this->data['features'], true); } public function getFeatures() { return $this->fromData('features'); } /** * @param $type * @param $url */ public function setWebhook($type, $url): self { if (!in_array($type, [self::WEBHOOK_MESSAGE, self::WEBHOOK_VOICE_STATUS], true)) { throw new InvalidArgumentException("invalid webhook type `$type`"); } $this->data[$type] = $url; return $this; } /** * @param $type */ public function getWebhook($type) { return $this->fromData($type); } /** * @param $type */ public function hasWebhook($type): bool { return isset($this->data[$type]); } /** * @param $endpoint * @param $type */ public function setVoiceDestination($endpoint, $type = null): self { if (is_null($type)) { $type = $this->autoType($endpoint); } if (self::ENDPOINT_APP === $type && !($endpoint instanceof Application)) { $endpoint = new Application($endpoint); } $this->data['voiceCallbackValue'] = $endpoint; $this->data['voiceCallbackType'] = $type; return $this; } /** * @param $endpoint */ protected function autoType($endpoint): string { if ($endpoint instanceof Application) { return self::ENDPOINT_APP; } if (false !== strpos($endpoint, '@')) { return self::ENDPOINT_SIP; } if (0 === stripos($endpoint, 'http')) { return self::ENDPOINT_VXML; } if (preg_match('#[a-z]+#', $endpoint)) { return self::ENDPOINT_APP; } return self::ENDPOINT_TEL; } public function getVoiceDestination() { return $this->fromData('voiceCallbackValue'); } /** * @return mixed|null */ public function getVoiceType() { return $this->data['voiceCallbackType'] ?? null; } /** * @param $name */ protected function fromData($name) { if (!isset($this->data[$name])) { throw new RuntimeException("`{$name}` has not been set"); } return $this->data[$name]; } /** * @param string|array $json */ public function jsonUnserialize($json): void { trigger_error( $this::class . "::jsonUnserialize is deprecated, please fromArray() instead", E_USER_DEPRECATED ); $jsonArr = json_decode($json, true); if (json_last_error() === JSON_ERROR_NONE) { $json = $jsonArr; } $this->fromArray($json); } public function fromArray(array $data): void { $this->data = $data; } /** * @return array|mixed */ #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->toArray(); } public function toArray(): array { $json = $this->data; // Swap to using app_id instead if (isset($json['messagesCallbackType'])) { $json['app_id'] = $json['messagesCallbackValue']; unset($json['messagesCallbackValue'], $json['messagesCallbackType']); } if (isset($json['voiceCallbackValue']) && ($json['voiceCallbackValue'] instanceof Application)) { $json['app_id'] = $json['voiceCallbackValue']->getId(); unset($json['voiceCallbackValue'], $json['voiceCallbackType']); } if (isset($json['voiceCallbackValue']) && $json['voiceCallbackType'] === 'app') { $json['app_id'] = $json['voiceCallbackValue']; unset($json['voiceCallbackValue'], $json['voiceCallbackType']); } return $json; } /** * @return string */ public function __toString(): string { return (string)$this->getId(); } /** * @return $this */ public function setAppId(string $appId): self { $this->data['messagesCallbackType'] = self::ENDPOINT_APP; $this->data['messagesCallbackValue'] = $appId; $this->data['voiceCallbackType'] = self::ENDPOINT_APP; $this->data['voiceCallbackValue'] = $appId; return $this; } public function getAppId(): ?string { // These should never be different, but might not both be set return $this->data['voiceCallbackValue'] ?? $this->data['messagesCallbackValue']; } } error_log 0000644 00000001243 15111720236 0006457 0 ustar 00 [26-Nov-2025 17:10:11 UTC] PHP Fatal error: Uncaught Error: Interface "Vonage\Entity\Hydrator\HydratorInterface" not found in /home/fluxyjvi/public_html/project/vendor/vonage/client-core/src/Numbers/Hydrator.php:16 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/vonage/client-core/src/Numbers/Hydrator.php on line 16 [26-Nov-2025 19:04:15 UTC] PHP Fatal error: Uncaught Error: Interface "Vonage\Client\APIClient" not found in /home/fluxyjvi/public_html/project/vendor/vonage/client-core/src/Numbers/Client.php:32 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/vonage/client-core/src/Numbers/Client.php on line 32 Hydrator.php 0000644 00000001176 15111720236 0007054 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\Numbers; use Vonage\Entity\Hydrator\HydratorInterface; class Hydrator implements HydratorInterface { public function hydrate(array $data) { $number = new Number(); return $this->hydrateObject($data, $number); } public function hydrateObject(array $data, $object) { $object->fromArray($data); return $object; } }
Simpan