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:
Users.tar
Filter/UserFilter.php 0000644 00000003027 15107364535 0010601 0 ustar 00 <?php declare(strict_types=1); namespace Vonage\Users\Filter; use InvalidArgumentException; use Vonage\Entity\Filter\FilterInterface; class UserFilter implements FilterInterface { public const ORDER_ASC = 'asc'; public const ORDER_DESC = 'desc'; protected ?int $pageSize = null; protected ?string $order = null; protected ?string $cursor = null; public function getQuery(): array { $query = []; if ($this->pageSize !== null) { $query['page_size'] = $this->getPageSize(); } if ($this->order !== null) { $query['order'] = $this->getOrder(); } if ($this->cursor !== null) { $query['cursor'] = $this->getCursor(); } return $query; } public function getPageSize(): int { return $this->pageSize; } public function setPageSize(int $pageSize): static { $this->pageSize = $pageSize; return $this; } public function getOrder(): string { return $this->order; } public function setOrder(string $order): static { if ($order !== self::ORDER_ASC && $order !== self::ORDER_DESC) { throw new InvalidArgumentException('Order must be `asc` or `desc`'); } $this->order = $order; return $this; } public function getCursor(): ?string { return $this->cursor; } public function setCursor(?string $cursor): static { $this->cursor = $cursor; return $this; } } ClientFactory.php 0000644 00000001221 15107364535 0010030 0 ustar 00 <?php declare(strict_types=1); namespace Vonage\Users; use Psr\Container\ContainerInterface; use Vonage\Client\APIResource; use Vonage\Client\Credentials\Handler\KeypairHandler; use Vonage\Entity\Hydrator\ArrayHydrator; class ClientFactory { public function __invoke(ContainerInterface $container): Client { $api = $container->make(APIResource::class); $api ->setBaseUri('/v1/users') ->setCollectionName('users') ->setAuthHandler(new KeypairHandler()); $hydrator = new ArrayHydrator(); $hydrator->setPrototype(new User()); return new Client($api, $hydrator); } } Client.php 0000644 00000004034 15107364535 0006505 0 ustar 00 <?php declare(strict_types=1); namespace Vonage\Users; use Vonage\Client\APIClient; use Vonage\Client\APIResource; use Vonage\Client\ClientAwareInterface; use Vonage\Client\ClientAwareTrait; use Vonage\Client\Exception\Exception as ClientException; use Vonage\Entity\Filter\EmptyFilter; use Vonage\Entity\Hydrator\HydratorInterface; use Vonage\Entity\IterableAPICollection; use Vonage\Entity\Filter\FilterInterface; use Vonage\Users\Filter\UserFilter; use function is_null; class Client implements ClientAwareInterface, APIClient { use ClientAwareTrait; public function __construct(protected APIResource $api, protected ?HydratorInterface $hydrator = null) { } public function getApiResource(): APIResource { return $this->api; } public function listUsers(FilterInterface $filter = null): IterableAPICollection { if (is_null($filter)) { $filter = new EmptyFilter(); } $response = $this->api->search($filter); $response->setHydrator($this->hydrator); $response->setPageSizeKey('page_size'); $response->setHasPagination(false); return $response; } public function createUser(User $user): User { $response = $this->api->create($user->toArray()); return $this->hydrator->hydrate($response); } public function getUser(string $id): User { $response = $this->api->get($id); return $this->hydrator->hydrate($response); return $returnUser; } public function updateUser(User $user): User { if (is_null($user->getId())) { throw new \InvalidArgumentException('User must have an ID set'); } $response = $this->api->partiallyUpdate($user->getId(), $user->toArray()); return $this->hydrator->hydrate($response); } public function deleteUser(string $id): bool { try { $this->api->delete($id); return true; } catch (ClientException $exception) { return false; } } } User.php 0000644 00000006727 15107364535 0006220 0 ustar 00 <?php namespace Vonage\Users; use Vonage\Entity\Hydrator\ArrayHydrateInterface; class User implements ArrayHydrateInterface { protected ?string $id = null; protected ?string $name = null; protected ?string $displayName = null; protected ?string $imageUrl = null; protected ?array $properties = null; protected ?array $channels = null; protected ?string $selfLink = null; public function getId(): ?string { return $this->id; } public function setId(string $id): static { $this->id = $id; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getDisplayName(): ?string { return $this->displayName; } public function setDisplayName(string $displayName): static { $this->displayName = $displayName; return $this; } public function getImageUrl(): ?string { return $this->imageUrl; } public function setImageUrl(string $imageUrl): static { $this->imageUrl = $imageUrl; return $this; } public function getProperties(): ?array { return $this->properties; } public function setProperties(array $properties): static { $this->properties = $properties; return $this; } public function getChannels(): array { return $this->channels; } public function setChannels(array $channels): static { $this->channels = $channels; return $this; } public function getSelfLink(): ?string { return $this->selfLink; } public function setSelfLink(string $selfLink): static { $this->selfLink = $selfLink; return $this; } public function fromArray(array $data): static { if (isset($data['id'])) { $this->setId($data['id']); } if (isset($data['name'])) { $this->setName($data['name']); } if (isset($data['display_name'])) { $this->setDisplayName($data['display_name']); } if (isset($data['image_url'])) { $this->setImageUrl($data['image_url']); } if (isset($data['properties'])) { $this->setProperties($data['properties']); } if (isset($data['channels'])) { $this->setChannels($data['channels']); } if (isset($data['_links']['self']['href'])) { $this->setSelfLink($data['_links']['self']['href']); } return $this; } public function toArray(): array { $data = []; if ($this->id !== null) { $data['id'] = $this->getId(); } if ($this->name !== null) { $data['name'] = $this->getName(); } if ($this->displayName !== null) { $data['display_name'] = $this->getDisplayName(); } if ($this->imageUrl !== null) { $data['image_url'] = $this->getImageUrl(); } if ($this->properties !== null) { $data['properties'] = $this->getProperties(); } if ($this->channels !== null) { $data['channels'] = $this->getChannels(); } if ($this->selfLink !== null) { $data['_links']['self']['href'] = $this->getSelfLink(); } return $data; } }
Simpan