From a7f3e21780df8bc0119b346ee69a0030c4e22413 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 13:25:38 -0800 Subject: [PATCH 01/64] feat: add topic poc --- .DS_Store | Bin 0 -> 8196 bytes composer.json | 1 + examples/topic-example.php | 74 ++++++ .../CacheOperationTypes.php | 40 +++ src/Topic/Internal/ScsTopicClient.php | 127 +++++++++ src/Topic/Internal/TopicGrpcManager.php | 49 ++++ src/Topic/TopicClient.php | 64 +++++ types/.DS_Store | Bin 0 -> 6148 bytes types/Auth/_GenerateApiTokenRequest.php | 68 ++++- .../_GenerateApiTokenRequest/CacheRole.php | 55 ---- .../ExplicitPermissions.php | 61 ----- .../_GenerateApiTokenRequest/Permissions.php | 99 ------- .../PermissionsType.php | 99 ------- .../PermissionsType/CachePermissions.php | 61 ----- .../PermissionsType/TopicPermissions.php | 61 ----- .../SuperUserPermissions.php | 46 ---- .../_GenerateApiTokenRequest/TopicRole.php | 55 ---- .../_GenerateApiTokenRequest_CacheRole.php | 16 -- ...ateApiTokenRequest_ExplicitPermissions.php | 16 -- .../_GenerateApiTokenRequest_Permissions.php | 16 -- ...enerateApiTokenRequest_PermissionsType.php | 16 -- ...quest_PermissionsType_CachePermissions.php | 16 -- ...quest_PermissionsType_TopicPermissions.php | 16 -- ...teApiTokenRequest_SuperUserPermissions.php | 16 -- .../_GenerateApiTokenRequest_TopicRole.php | 16 -- types/Cache_client/.DS_Store | Bin 0 -> 6148 bytes types/Cache_client/Pubsub/PubsubClient.php | 77 ++++++ types/Cache_client/Pubsub/_Discontinuity.php | 103 ++++++++ types/Cache_client/Pubsub/_Empty.php | 31 +++ types/Cache_client/Pubsub/_Heartbeat.php | 39 +++ types/Cache_client/Pubsub/_PublishRequest.php | 149 +++++++++++ .../Cache_client/Pubsub/_SubscriptionItem.php | 152 +++++++++++ .../Pubsub/_SubscriptionRequest.php | 151 +++++++++++ types/Cache_client/Pubsub/_TopicItem.php | 173 +++++++++++++ types/Cache_client/Pubsub/_TopicValue.php | 98 +++++++ types/Cache_client/ScsClient.php | 44 ++++ types/Cache_client/_SetPopRequest.php | 85 ++++++ types/Cache_client/_SetPopResponse.php | 96 +++++++ types/Cache_client/_SetPopResponse/_Found.php | 61 +++++ .../Cache_client/_SetPopResponse/_Missing.php | 34 +++ types/Cache_client/_SetPopResponse__Found.php | 16 ++ .../Cache_client/_SetPopResponse__Missing.php | 16 ++ .../_SortedSetLengthByScoreRequest.php | 244 ++++++++++++++++++ .../_SortedSetLengthByScoreResponse.php | 96 +++++++ .../_Found.php | 61 +++++ .../_Missing.php | 34 +++ ..._SortedSetLengthByScoreResponse__Found.php | 16 ++ ...ortedSetLengthByScoreResponse__Missing.php | 16 ++ .../Cache_client/_SortedSetLengthRequest.php | 58 +++++ .../Cache_client/_SortedSetLengthResponse.php | 96 +++++++ .../_SortedSetLengthResponse/_Found.php | 61 +++++ .../_SortedSetLengthResponse/_Missing.php | 34 +++ .../_SortedSetLengthResponse__Found.php | 16 ++ .../_SortedSetLengthResponse__Missing.php | 16 ++ types/Control_client/ScsControlClient.php | 42 +++ types/Control_client/_Cache.php | 74 ++++++ types/Control_client/_CacheLimits.php | 167 ++++++++++++ types/Control_client/_CreateIndexRequest.php | 122 +++++++++ types/Control_client/_CreateIndexResponse.php | 31 +++ types/Control_client/_DeleteIndexRequest.php | 58 +++++ types/Control_client/_DeleteIndexResponse.php | 31 +++ types/Control_client/_ListIndexesRequest.php | 31 +++ types/Control_client/_ListIndexesResponse.php | 58 +++++ .../_ListIndexesResponse/_Index.php | 125 +++++++++ .../_ListIndexesResponse__Index.php | 16 ++ types/Control_client/_SimilarityMetric.php | 124 +++++++++ .../_SimilarityMetric/_CosineSimilarity.php | 34 +++ .../_EuclideanSimilarity.php | 34 +++ .../_SimilarityMetric/_InnerProduct.php | 34 +++ .../_SimilarityMetric__CosineSimilarity.php | 16 ++ ..._SimilarityMetric__EuclideanSimilarity.php | 16 ++ .../_SimilarityMetric__InnerProduct.php | 16 ++ types/Control_client/_TopicLimits.php | 133 ++++++++++ types/GPBMetadata/Auth.php | Bin 2565 -> 1867 bytes types/GPBMetadata/Cacheclient.php | Bin 15159 -> 16446 bytes types/GPBMetadata/Cachepubsub.php | Bin 0 -> 1581 bytes types/GPBMetadata/Controlclient.php | Bin 2086 -> 3495 bytes 77 files changed, 3651 insertions(+), 672 deletions(-) create mode 100644 .DS_Store create mode 100644 examples/topic-example.php create mode 100644 src/Topic/Internal/ScsTopicClient.php create mode 100644 src/Topic/Internal/TopicGrpcManager.php create mode 100644 src/Topic/TopicClient.php create mode 100644 types/.DS_Store delete mode 100644 types/Auth/_GenerateApiTokenRequest/CacheRole.php delete mode 100644 types/Auth/_GenerateApiTokenRequest/ExplicitPermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest/Permissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest/PermissionsType.php delete mode 100644 types/Auth/_GenerateApiTokenRequest/PermissionsType/CachePermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest/PermissionsType/TopicPermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest/SuperUserPermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest/TopicRole.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_CacheRole.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_ExplicitPermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_Permissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_PermissionsType.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_PermissionsType_CachePermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_PermissionsType_TopicPermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_SuperUserPermissions.php delete mode 100644 types/Auth/_GenerateApiTokenRequest_TopicRole.php create mode 100644 types/Cache_client/.DS_Store create mode 100644 types/Cache_client/Pubsub/PubsubClient.php create mode 100644 types/Cache_client/Pubsub/_Discontinuity.php create mode 100644 types/Cache_client/Pubsub/_Empty.php create mode 100644 types/Cache_client/Pubsub/_Heartbeat.php create mode 100644 types/Cache_client/Pubsub/_PublishRequest.php create mode 100644 types/Cache_client/Pubsub/_SubscriptionItem.php create mode 100644 types/Cache_client/Pubsub/_SubscriptionRequest.php create mode 100644 types/Cache_client/Pubsub/_TopicItem.php create mode 100644 types/Cache_client/Pubsub/_TopicValue.php create mode 100644 types/Cache_client/_SetPopRequest.php create mode 100644 types/Cache_client/_SetPopResponse.php create mode 100644 types/Cache_client/_SetPopResponse/_Found.php create mode 100644 types/Cache_client/_SetPopResponse/_Missing.php create mode 100644 types/Cache_client/_SetPopResponse__Found.php create mode 100644 types/Cache_client/_SetPopResponse__Missing.php create mode 100644 types/Cache_client/_SortedSetLengthByScoreRequest.php create mode 100644 types/Cache_client/_SortedSetLengthByScoreResponse.php create mode 100644 types/Cache_client/_SortedSetLengthByScoreResponse/_Found.php create mode 100644 types/Cache_client/_SortedSetLengthByScoreResponse/_Missing.php create mode 100644 types/Cache_client/_SortedSetLengthByScoreResponse__Found.php create mode 100644 types/Cache_client/_SortedSetLengthByScoreResponse__Missing.php create mode 100644 types/Cache_client/_SortedSetLengthRequest.php create mode 100644 types/Cache_client/_SortedSetLengthResponse.php create mode 100644 types/Cache_client/_SortedSetLengthResponse/_Found.php create mode 100644 types/Cache_client/_SortedSetLengthResponse/_Missing.php create mode 100644 types/Cache_client/_SortedSetLengthResponse__Found.php create mode 100644 types/Cache_client/_SortedSetLengthResponse__Missing.php create mode 100644 types/Control_client/_CacheLimits.php create mode 100644 types/Control_client/_CreateIndexRequest.php create mode 100644 types/Control_client/_CreateIndexResponse.php create mode 100644 types/Control_client/_DeleteIndexRequest.php create mode 100644 types/Control_client/_DeleteIndexResponse.php create mode 100644 types/Control_client/_ListIndexesRequest.php create mode 100644 types/Control_client/_ListIndexesResponse.php create mode 100644 types/Control_client/_ListIndexesResponse/_Index.php create mode 100644 types/Control_client/_ListIndexesResponse__Index.php create mode 100644 types/Control_client/_SimilarityMetric.php create mode 100644 types/Control_client/_SimilarityMetric/_CosineSimilarity.php create mode 100644 types/Control_client/_SimilarityMetric/_EuclideanSimilarity.php create mode 100644 types/Control_client/_SimilarityMetric/_InnerProduct.php create mode 100644 types/Control_client/_SimilarityMetric__CosineSimilarity.php create mode 100644 types/Control_client/_SimilarityMetric__EuclideanSimilarity.php create mode 100644 types/Control_client/_SimilarityMetric__InnerProduct.php create mode 100644 types/Control_client/_TopicLimits.php create mode 100644 types/GPBMetadata/Cachepubsub.php diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..591fb70a16e32ba002745ff2b50d3fce83246174 GIT binary patch literal 8196 zcmeHM&2G~`5T0#Xa0t-wQ>jQGS>oD;rid1aOGs0p9{5pH-~gz^acE5)JH$ytR7J`i zo`F~3%!9zYaDs1k-O64kNL&zAcctA~ujiYc{bp@vHbf+FbrfF;N1NZHIccusgugzBU}Yre%N&U(18{| zSPxN4zhpsgGSUaGNe3G8tA?DX4SGsXXot3Gi>mY-y)9fn!r4Ka+%#I;($Lq)#W}+v zEknxL=Hw{&Je#KfUDGc>Zy%NY_TX6w=r;LjRBl5<6(^&B zc3}l8Oygy|za-*apbuD?3qJ$Y5)Gxt+N{K}PNJ?L#+$HJqsNfTSYHT+_b_9Cc3QlX z7OrX*I*3n*6%YSlgQK0aF|XNpMsFnh9MdHFVhYXYTfF|vPL**@;_@0Ui{Qv6 z5$Uy-?%a9HvI^Fl`hGa5_Zq!^RBd!$@zqWk`p$8`;k@u#gWclw zjWFmnyr9*U0MBhf<@HN1aKk}0><4Znv2}IB%IEXD#T!RQt9RFy?A4X>Xvsb*m)Gwv z+3V$dqfy>kxP9lr_U?h-4np1}C?ftHTD?{UZrV4Eb8Q>-Eh-n*8!IUxXkgetLoggerFactory()->getLogger("ex:"); + +function printBanner(string $message, LoggerInterface $logger): void +{ + $line = "******************************************************************"; + $logger->info($line); + $logger->info($message); + $logger->info($line); +} + +printBanner("* Momento Example Start *", $logger); + +// Ensure test cache exists +$response = $client->createCache($CACHE_NAME); +if ($response->asSuccess()) { + $logger->info("Created cache " . $CACHE_NAME . "\n"); +} elseif ($response->asError()) { + $logger->info("Error creating cache: " . $response->asError()->message() . "\n"); + exit(1); +} elseif ($response->asAlreadyExists()) { + $logger->info("Cache " . $CACHE_NAME . " already exists.\n"); +} + +// Subscribe to topic +//$logger->info("Subscribing to topic: $TOPIC_NAME\n"); +//$response = $topicClient->subscribe($TOPIC_NAME, $CACHE_NAME); +//if ($response->asSubscription()) { +// $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); +//} elseif ($response->asError()) { +// $logger->info("Error subscribing to topic: " . $response->asError()->message() . "\n"); +// exit(1); +//} + +// Publish to topic +$logger->info("Publishing to topic: $TOPIC_NAME\n"); +$response = $topicClient->publish($TOPIC_NAME, $CACHE_NAME, "MyMessage"); +if ($response->asSuccess()) { + $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); +} elseif ($response->asError()) { + $logger->info("Error subscribing to topic: " . $response->asError()->message() . "\n"); + exit(1); +} + + +// Delete test cache +$logger->info("Deleting cache $CACHE_NAME\n"); +$response = $client->deleteCache($CACHE_NAME); +if ($response->asError()) { + $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); + exit(1); +} + +printBanner("* Momento Example End *", $logger); diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index 4bf5737a..f4922d8f 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -2635,3 +2635,43 @@ class SetRemoveElementError extends SetRemoveElementResponse { use ErrorBody; } + +abstract class TopicPublishResponse extends ResponseBase +{ + /** + * @return TopicPublishResponseSuccess|null + */ + public function asSuccess(): ?TopicPublishResponseSuccess + { + if ($this->isSuccess()) { + return $this; + } + return null; + } + + /** + * @return TopicPublishResponseError|null Returns the error subtype if the request returned an error and null otherwise. + */ + public function asError(): ?TopicPublishResponseError + { + if ($this->isError()) { + return $this; + } + return null; + } +} + +/** + * Indicates that the request that generated it was successful. + */ +class TopicPublishResponseSuccess extends TopicPublishResponse +{ +} + +/** + * Contains information about an error returned from the request. + */ +class TopicPublishResponseError extends TopicPublishResponse +{ + use ErrorBody; +} diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php new file mode 100644 index 00000000..7b53cd9d --- /dev/null +++ b/src/Topic/Internal/ScsTopicClient.php @@ -0,0 +1,127 @@ +getTransportStrategy() + ->getGrpcConfig() + ->getDeadlineMilliseconds(); + validateOperationTimeout($operationTimeoutMs); + $this->deadline_milliseconds = $operationTimeoutMs ?? self::$DEFAULT_DEADLINE_MILLISECONDS; + $this->timeout = $this->deadline_milliseconds * self::$TIMEOUT_MULTIPLIER; + $this->grpcManager = new TopicGrpcManager($authProvider, $configuration); + $this->setLogger($configuration->getLoggerFactory()->getLogger(get_class($this))); + } + + public function setLogger(LoggerInterface $logger): void + { + $this->logger = $logger; + } + + private function ttlToMillis(?int $ttl = null): int + { + if (!$ttl) { + $ttl = $this->defaultTtlSeconds; + } + validateTtl($ttl); + return $ttl * 1000; + } + + private function returnCollectionTtl(?CollectionTtl $ttl): CollectionTtl + { + if (!$ttl) { + return CollectionTtl::fromCacheTtl(); + } + return $ttl; + } + + private function processCall(UnaryCall $call) + { + [$response, $status] = $call->wait(); + if ($status->code !== 0) { + $this->logger->debug("Data client error: {$status->details}"); + throw _ErrorConverter::convert($status->code, $status->details, $call->getMetadata()); + } + return $response; + } + + + /** + * @return ResponseFuture + */ + public function publish(string $cacheName, string $topicName, string $value): ResponseFuture + { + $topicValue = new _TopicValue(); + $topicValue->setText($value); + try { + validateCacheName($cacheName); + $publishRequest = new _PublishRequest(); + $publishRequest->setCacheName($cacheName); + $publishRequest->setTopic($topicName); + $publishRequest->setValue($topicValue); + + $call = $this->grpcManager->client->Publish($publishRequest,); + } catch (SdkError $e) { + $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); + return ResponseFuture::createResolved(new TopicPublishResponseError($e)); + } catch (Exception $e) { + $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); + return ResponseFuture::createResolved(new TopicPublishResponseError(new UnknownError($e->getMessage()))); + } + + return ResponseFuture::createPending( + function () use ($call): TopicPublishResponse { + try { + $this->processCall($call); + } catch (SdkError $e) { + return new TopicPublishResponseError($e); + } catch (Exception $e) { + return new TopicPublishResponseError(new UnknownError($e->getMessage())); + } + + return new TopicPublishResponseSuccess(); + } + ); + } + + + public function close(): void + { + $this->grpcManager->close(); + } +} diff --git a/src/Topic/Internal/TopicGrpcManager.php b/src/Topic/Internal/TopicGrpcManager.php new file mode 100644 index 00000000..b49119c8 --- /dev/null +++ b/src/Topic/Internal/TopicGrpcManager.php @@ -0,0 +1,49 @@ +getCacheEndpoint(); + $channelArgs = ["credentials" => ChannelCredentials::createSsl()]; + if ($authProvider->getTrustedCacheEndpointCertificateName()) { + $channelArgs["grpc.ssl_target_name_override"] = $authProvider->getTrustedCacheEndpointCertificateName(); + } + $forceNewChannel = $configuration + ->getTransportStrategy() + ->getGrpcConfig() + ->getForceNewChannel(); + if ($forceNewChannel) { + $channelArgs["force_new"] = $forceNewChannel; + } + $this->channel = new Channel($endpoint, $channelArgs); + $interceptors = [ + new AuthorizationInterceptor($authProvider->getAuthToken()), + new AgentInterceptor(), + ]; + $interceptedChannel = Interceptor::intercept($this->channel, $interceptors); + + $options = []; + $this->client = new PubsubClient($endpoint, $options, $interceptedChannel); + } + + public function close(): void { + $this->channel->close(); + } +} diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php new file mode 100644 index 00000000..f5c48619 --- /dev/null +++ b/src/Topic/TopicClient.php @@ -0,0 +1,64 @@ +configuration = $configuration; + $this->loggerFactory = $configuration->getLoggerFactory(); + $this->setLogger($this->loggerFactory->getLogger(get_class($this))); + $this->topicClient = new ScsTopicClient($this->configuration, $authProvider); + } + + /** + * Close the client and free up all associated resources. NOTE: the client object will not be usable after calling + * this method. + */ + public function close(): void + { + $this->topicClient->close(); + } + + + /** + * Assigns a LoggerInterface logging object to the client. + * + * @param LoggerInterface $logger Object to use for logging + * @return void + */ + public function setLogger(LoggerInterface $logger): void + { + $this->logger = $logger; + } + + public function publish(string $cacheName, string $topicName, string $message): TopicPublishResponse + { + $this->logger->info("Publishing to topic: $topicName\n"); + return $this->topicClient->publish($cacheName, $topicName, $message)-> wait(); + } +} diff --git a/types/.DS_Store b/types/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..222d2fb4db7bdc7e2100149b185c75e881af8355 GIT binary patch literal 6148 zcmeHKO-sW-5PegFv{a-=FG7An!GDm(1o0q<{s6U!P+>Ko={IHcv=6FOsV7w0)9GaN|rhqB13koo2 ztBt1ttu+Nq0aIY3fPNoRx?&cw3+O)`Y-x^+3twJH6UuBQ9CfEx-sJ{5DXrs5;IH_oTpA!ZS~fSjS(kARoK K8dKm;75D`7(pl>O literal 0 HcmV?d00001 diff --git a/types/Auth/_GenerateApiTokenRequest.php b/types/Auth/_GenerateApiTokenRequest.php index 21534104..318bc982 100644 --- a/types/Auth/_GenerateApiTokenRequest.php +++ b/types/Auth/_GenerateApiTokenRequest.php @@ -18,9 +18,17 @@ class _GenerateApiTokenRequest extends \Google\Protobuf\Internal\Message */ protected $auth_token = ''; /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.Permissions permissions = 4; + * Generated from protobuf field .permission_messages.Permissions permissions = 4; */ protected $permissions = null; + /** + * Generated from protobuf field string token_id = 5; + */ + protected $token_id = ''; + /** + * Generated from protobuf field string description = 6; + */ + protected $description = ''; protected $expiry; /** @@ -32,7 +40,9 @@ class _GenerateApiTokenRequest extends \Google\Protobuf\Internal\Message * @type \Auth\_GenerateApiTokenRequest\Never $never * @type \Auth\_GenerateApiTokenRequest\Expires $expires * @type string $auth_token - * @type \Auth\_GenerateApiTokenRequest\Permissions $permissions + * @type \Permission_messages\Permissions $permissions + * @type string $token_id + * @type string $description * } */ public function __construct($data = NULL) { @@ -117,8 +127,8 @@ public function setAuthToken($var) } /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.Permissions permissions = 4; - * @return \Auth\_GenerateApiTokenRequest\Permissions|null + * Generated from protobuf field .permission_messages.Permissions permissions = 4; + * @return \Permission_messages\Permissions|null */ public function getPermissions() { @@ -136,18 +146,62 @@ public function clearPermissions() } /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.Permissions permissions = 4; - * @param \Auth\_GenerateApiTokenRequest\Permissions $var + * Generated from protobuf field .permission_messages.Permissions permissions = 4; + * @param \Permission_messages\Permissions $var * @return $this */ public function setPermissions($var) { - GPBUtil::checkMessage($var, \Auth\_GenerateApiTokenRequest\Permissions::class); + GPBUtil::checkMessage($var, \Permission_messages\Permissions::class); $this->permissions = $var; return $this; } + /** + * Generated from protobuf field string token_id = 5; + * @return string + */ + public function getTokenId() + { + return $this->token_id; + } + + /** + * Generated from protobuf field string token_id = 5; + * @param string $var + * @return $this + */ + public function setTokenId($var) + { + GPBUtil::checkString($var, True); + $this->token_id = $var; + + return $this; + } + + /** + * Generated from protobuf field string description = 6; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Generated from protobuf field string description = 6; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + /** * @return string */ diff --git a/types/Auth/_GenerateApiTokenRequest/CacheRole.php b/types/Auth/_GenerateApiTokenRequest/CacheRole.php deleted file mode 100644 index ff4b1afb..00000000 --- a/types/Auth/_GenerateApiTokenRequest/CacheRole.php +++ /dev/null @@ -1,55 +0,0 @@ -auth._GenerateApiTokenRequest.CacheRole - */ -class CacheRole -{ - /** - * Generated from protobuf enum CachePermitNone = 0; - */ - const CachePermitNone = 0; - /** - * Restricts access to apis that read and write data from caches: No higher level resource description or modification. - * - * Generated from protobuf enum CacheReadWrite = 1; - */ - const CacheReadWrite = 1; - - private static $valueToName = [ - self::CachePermitNone => 'CachePermitNone', - self::CacheReadWrite => 'CacheReadWrite', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CacheRole::class, \Auth\_GenerateApiTokenRequest_CacheRole::class); - diff --git a/types/Auth/_GenerateApiTokenRequest/ExplicitPermissions.php b/types/Auth/_GenerateApiTokenRequest/ExplicitPermissions.php deleted file mode 100644 index fb92ff88..00000000 --- a/types/Auth/_GenerateApiTokenRequest/ExplicitPermissions.php +++ /dev/null @@ -1,61 +0,0 @@ -auth._GenerateApiTokenRequest.ExplicitPermissions - */ -class ExplicitPermissions extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field repeated .auth._GenerateApiTokenRequest.PermissionsType permissions = 1; - */ - private $permissions; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Auth\_GenerateApiTokenRequest\PermissionsType[]|\Google\Protobuf\Internal\RepeatedField $permissions - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Auth::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field repeated .auth._GenerateApiTokenRequest.PermissionsType permissions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPermissions() - { - return $this->permissions; - } - - /** - * Generated from protobuf field repeated .auth._GenerateApiTokenRequest.PermissionsType permissions = 1; - * @param \Auth\_GenerateApiTokenRequest\PermissionsType[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPermissions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Auth\_GenerateApiTokenRequest\PermissionsType::class); - $this->permissions = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ExplicitPermissions::class, \Auth\_GenerateApiTokenRequest_ExplicitPermissions::class); - diff --git a/types/Auth/_GenerateApiTokenRequest/Permissions.php b/types/Auth/_GenerateApiTokenRequest/Permissions.php deleted file mode 100644 index a958a139..00000000 --- a/types/Auth/_GenerateApiTokenRequest/Permissions.php +++ /dev/null @@ -1,99 +0,0 @@ -auth._GenerateApiTokenRequest.Permissions - */ -class Permissions extends \Google\Protobuf\Internal\Message -{ - protected $kind; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $super_user - * @type \Auth\_GenerateApiTokenRequest\ExplicitPermissions $explicit - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Auth::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.SuperUserPermissions super_user = 1; - * @return int - */ - public function getSuperUser() - { - return $this->readOneof(1); - } - - public function hasSuperUser() - { - return $this->hasOneof(1); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.SuperUserPermissions super_user = 1; - * @param int $var - * @return $this - */ - public function setSuperUser($var) - { - GPBUtil::checkEnum($var, \Auth\_GenerateApiTokenRequest\SuperUserPermissions::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.ExplicitPermissions explicit = 2; - * @return \Auth\_GenerateApiTokenRequest\ExplicitPermissions|null - */ - public function getExplicit() - { - return $this->readOneof(2); - } - - public function hasExplicit() - { - return $this->hasOneof(2); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.ExplicitPermissions explicit = 2; - * @param \Auth\_GenerateApiTokenRequest\ExplicitPermissions $var - * @return $this - */ - public function setExplicit($var) - { - GPBUtil::checkMessage($var, \Auth\_GenerateApiTokenRequest\ExplicitPermissions::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getKind() - { - return $this->whichOneof("kind"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Permissions::class, \Auth\_GenerateApiTokenRequest_Permissions::class); - diff --git a/types/Auth/_GenerateApiTokenRequest/PermissionsType.php b/types/Auth/_GenerateApiTokenRequest/PermissionsType.php deleted file mode 100644 index 93ec064e..00000000 --- a/types/Auth/_GenerateApiTokenRequest/PermissionsType.php +++ /dev/null @@ -1,99 +0,0 @@ -auth._GenerateApiTokenRequest.PermissionsType - */ -class PermissionsType extends \Google\Protobuf\Internal\Message -{ - protected $kind; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Auth\_GenerateApiTokenRequest\PermissionsType\CachePermissions $cache_permissions - * @type \Auth\_GenerateApiTokenRequest\PermissionsType\TopicPermissions $topic_permissions - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Auth::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.PermissionsType.CachePermissions cache_permissions = 1; - * @return \Auth\_GenerateApiTokenRequest\PermissionsType\CachePermissions|null - */ - public function getCachePermissions() - { - return $this->readOneof(1); - } - - public function hasCachePermissions() - { - return $this->hasOneof(1); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.PermissionsType.CachePermissions cache_permissions = 1; - * @param \Auth\_GenerateApiTokenRequest\PermissionsType\CachePermissions $var - * @return $this - */ - public function setCachePermissions($var) - { - GPBUtil::checkMessage($var, \Auth\_GenerateApiTokenRequest\PermissionsType\CachePermissions::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.PermissionsType.TopicPermissions topic_permissions = 2; - * @return \Auth\_GenerateApiTokenRequest\PermissionsType\TopicPermissions|null - */ - public function getTopicPermissions() - { - return $this->readOneof(2); - } - - public function hasTopicPermissions() - { - return $this->hasOneof(2); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.PermissionsType.TopicPermissions topic_permissions = 2; - * @param \Auth\_GenerateApiTokenRequest\PermissionsType\TopicPermissions $var - * @return $this - */ - public function setTopicPermissions($var) - { - GPBUtil::checkMessage($var, \Auth\_GenerateApiTokenRequest\PermissionsType\TopicPermissions::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getKind() - { - return $this->whichOneof("kind"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PermissionsType::class, \Auth\_GenerateApiTokenRequest_PermissionsType::class); - diff --git a/types/Auth/_GenerateApiTokenRequest/PermissionsType/CachePermissions.php b/types/Auth/_GenerateApiTokenRequest/PermissionsType/CachePermissions.php deleted file mode 100644 index bfb268b9..00000000 --- a/types/Auth/_GenerateApiTokenRequest/PermissionsType/CachePermissions.php +++ /dev/null @@ -1,61 +0,0 @@ -auth._GenerateApiTokenRequest.PermissionsType.CachePermissions - */ -class CachePermissions extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.CacheRole role = 1; - */ - protected $role = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $role - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Auth::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.CacheRole role = 1; - * @return int - */ - public function getRole() - { - return $this->role; - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.CacheRole role = 1; - * @param int $var - * @return $this - */ - public function setRole($var) - { - GPBUtil::checkEnum($var, \Auth\_GenerateApiTokenRequest\CacheRole::class); - $this->role = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CachePermissions::class, \Auth\_GenerateApiTokenRequest_PermissionsType_CachePermissions::class); - diff --git a/types/Auth/_GenerateApiTokenRequest/PermissionsType/TopicPermissions.php b/types/Auth/_GenerateApiTokenRequest/PermissionsType/TopicPermissions.php deleted file mode 100644 index 2c237395..00000000 --- a/types/Auth/_GenerateApiTokenRequest/PermissionsType/TopicPermissions.php +++ /dev/null @@ -1,61 +0,0 @@ -auth._GenerateApiTokenRequest.PermissionsType.TopicPermissions - */ -class TopicPermissions extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.TopicRole role = 1; - */ - protected $role = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $role - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Auth::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.TopicRole role = 1; - * @return int - */ - public function getRole() - { - return $this->role; - } - - /** - * Generated from protobuf field .auth._GenerateApiTokenRequest.TopicRole role = 1; - * @param int $var - * @return $this - */ - public function setRole($var) - { - GPBUtil::checkEnum($var, \Auth\_GenerateApiTokenRequest\TopicRole::class); - $this->role = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TopicPermissions::class, \Auth\_GenerateApiTokenRequest_PermissionsType_TopicPermissions::class); - diff --git a/types/Auth/_GenerateApiTokenRequest/SuperUserPermissions.php b/types/Auth/_GenerateApiTokenRequest/SuperUserPermissions.php deleted file mode 100644 index 9d97350e..00000000 --- a/types/Auth/_GenerateApiTokenRequest/SuperUserPermissions.php +++ /dev/null @@ -1,46 +0,0 @@ -auth._GenerateApiTokenRequest.SuperUserPermissions - */ -class SuperUserPermissions -{ - /** - * Generated from protobuf enum SuperUser = 0; - */ - const SuperUser = 0; - - private static $valueToName = [ - self::SuperUser => 'SuperUser', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SuperUserPermissions::class, \Auth\_GenerateApiTokenRequest_SuperUserPermissions::class); - diff --git a/types/Auth/_GenerateApiTokenRequest/TopicRole.php b/types/Auth/_GenerateApiTokenRequest/TopicRole.php deleted file mode 100644 index c798b8da..00000000 --- a/types/Auth/_GenerateApiTokenRequest/TopicRole.php +++ /dev/null @@ -1,55 +0,0 @@ -auth._GenerateApiTokenRequest.TopicRole - */ -class TopicRole -{ - /** - * Generated from protobuf enum TopicPermitNone = 0; - */ - const TopicPermitNone = 0; - /** - * Restricts access to apis that read and write data from topics: No higher level resource description or modification. - * - * Generated from protobuf enum TopicReadWrite = 1; - */ - const TopicReadWrite = 1; - - private static $valueToName = [ - self::TopicPermitNone => 'TopicPermitNone', - self::TopicReadWrite => 'TopicReadWrite', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TopicRole::class, \Auth\_GenerateApiTokenRequest_TopicRole::class); - diff --git a/types/Auth/_GenerateApiTokenRequest_CacheRole.php b/types/Auth/_GenerateApiTokenRequest_CacheRole.php deleted file mode 100644 index 81343d42..00000000 --- a/types/Auth/_GenerateApiTokenRequest_CacheRole.php +++ /dev/null @@ -1,16 +0,0 @@ -V4u473vzA<DubPd`})N&zYG-xc8Zp}~p0a7c_#2Zm??fD?qnFppjW*cbrz z!XXh6m?ssORIe7pla6?+yk0mYCf&T653ifOIuwuFaej+*^PZ?t3P^!_1>SQxXZ>Hp zf9e14Nm@w(DezJX_++(RE%BtPt)s`W);9PToH_simpleRequest('/cache_client.pubsub.Pubsub/Publish', + $argument, + ['\Cache_client\Pubsub\_Empty', 'decode'], + $metadata, $options); + } + + /** + * Subscribe to notifications from a topic. + * + * You will receive a stream of values and (hopefully occasional) discontinuities. + * Values will appear as copies of the payloads you Publish() to the topic. + * + * REQUIRES HEADER authorization: Momento auth token + * @param \Cache_client\Pubsub\_SubscriptionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\ServerStreamingCall + */ + public function Subscribe(\Cache_client\Pubsub\_SubscriptionRequest $argument, + $metadata = [], $options = []) { + return $this->_serverStreamRequest('/cache_client.pubsub.Pubsub/Subscribe', + $argument, + ['\Cache_client\Pubsub\_SubscriptionItem', 'decode'], + $metadata, $options); + } + +} diff --git a/types/Cache_client/Pubsub/_Discontinuity.php b/types/Cache_client/Pubsub/_Discontinuity.php new file mode 100644 index 00000000..8f34e11f --- /dev/null +++ b/types/Cache_client/Pubsub/_Discontinuity.php @@ -0,0 +1,103 @@ +cache_client.pubsub._Discontinuity + */ +class _Discontinuity extends \Google\Protobuf\Internal\Message +{ + /** + * The last topic value sequence number known to have been attempted (if known, 0 otherwise). + * + * Generated from protobuf field uint64 last_topic_sequence = 1; + */ + protected $last_topic_sequence = 0; + /** + * The new topic sequence number after which TopicItems will ostensibly resume. + * + * Generated from protobuf field uint64 new_topic_sequence = 2; + */ + protected $new_topic_sequence = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $last_topic_sequence + * The last topic value sequence number known to have been attempted (if known, 0 otherwise). + * @type int|string $new_topic_sequence + * The new topic sequence number after which TopicItems will ostensibly resume. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + + /** + * The last topic value sequence number known to have been attempted (if known, 0 otherwise). + * + * Generated from protobuf field uint64 last_topic_sequence = 1; + * @return int|string + */ + public function getLastTopicSequence() + { + return $this->last_topic_sequence; + } + + /** + * The last topic value sequence number known to have been attempted (if known, 0 otherwise). + * + * Generated from protobuf field uint64 last_topic_sequence = 1; + * @param int|string $var + * @return $this + */ + public function setLastTopicSequence($var) + { + GPBUtil::checkUint64($var); + $this->last_topic_sequence = $var; + + return $this; + } + + /** + * The new topic sequence number after which TopicItems will ostensibly resume. + * + * Generated from protobuf field uint64 new_topic_sequence = 2; + * @return int|string + */ + public function getNewTopicSequence() + { + return $this->new_topic_sequence; + } + + /** + * The new topic sequence number after which TopicItems will ostensibly resume. + * + * Generated from protobuf field uint64 new_topic_sequence = 2; + * @param int|string $var + * @return $this + */ + public function setNewTopicSequence($var) + { + GPBUtil::checkUint64($var); + $this->new_topic_sequence = $var; + + return $this; + } + +} + diff --git a/types/Cache_client/Pubsub/_Empty.php b/types/Cache_client/Pubsub/_Empty.php new file mode 100644 index 00000000..d6659d89 --- /dev/null +++ b/types/Cache_client/Pubsub/_Empty.php @@ -0,0 +1,31 @@ +cache_client.pubsub._Empty + */ +class _Empty extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + +} + diff --git a/types/Cache_client/Pubsub/_Heartbeat.php b/types/Cache_client/Pubsub/_Heartbeat.php new file mode 100644 index 00000000..8f5e2ab9 --- /dev/null +++ b/types/Cache_client/Pubsub/_Heartbeat.php @@ -0,0 +1,39 @@ +cache_client.pubsub._Heartbeat + */ +class _Heartbeat extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + +} + diff --git a/types/Cache_client/Pubsub/_PublishRequest.php b/types/Cache_client/Pubsub/_PublishRequest.php new file mode 100644 index 00000000..70e0dff2 --- /dev/null +++ b/types/Cache_client/Pubsub/_PublishRequest.php @@ -0,0 +1,149 @@ +cache_client.pubsub._PublishRequest + */ +class _PublishRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Cache namespace for the topic to which you want to send the value. + * + * Generated from protobuf field string cache_name = 1; + */ + protected $cache_name = ''; + /** + * The literal topic name to which you want to send the value. + * + * Generated from protobuf field string topic = 2; + */ + protected $topic = ''; + /** + * The value you want to send to the topic. All current subscribers will receive + * this, should the whims of the Internet prove merciful. + * + * Generated from protobuf field .cache_client.pubsub._TopicValue value = 3; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cache_name + * Cache namespace for the topic to which you want to send the value. + * @type string $topic + * The literal topic name to which you want to send the value. + * @type \Cache_client\Pubsub\_TopicValue $value + * The value you want to send to the topic. All current subscribers will receive + * this, should the whims of the Internet prove merciful. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + + /** + * Cache namespace for the topic to which you want to send the value. + * + * Generated from protobuf field string cache_name = 1; + * @return string + */ + public function getCacheName() + { + return $this->cache_name; + } + + /** + * Cache namespace for the topic to which you want to send the value. + * + * Generated from protobuf field string cache_name = 1; + * @param string $var + * @return $this + */ + public function setCacheName($var) + { + GPBUtil::checkString($var, True); + $this->cache_name = $var; + + return $this; + } + + /** + * The literal topic name to which you want to send the value. + * + * Generated from protobuf field string topic = 2; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * The literal topic name to which you want to send the value. + * + * Generated from protobuf field string topic = 2; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * The value you want to send to the topic. All current subscribers will receive + * this, should the whims of the Internet prove merciful. + * + * Generated from protobuf field .cache_client.pubsub._TopicValue value = 3; + * @return \Cache_client\Pubsub\_TopicValue|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value you want to send to the topic. All current subscribers will receive + * this, should the whims of the Internet prove merciful. + * + * Generated from protobuf field .cache_client.pubsub._TopicValue value = 3; + * @param \Cache_client\Pubsub\_TopicValue $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Cache_client\Pubsub\_TopicValue::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/types/Cache_client/Pubsub/_SubscriptionItem.php b/types/Cache_client/Pubsub/_SubscriptionItem.php new file mode 100644 index 00000000..9c8282f8 --- /dev/null +++ b/types/Cache_client/Pubsub/_SubscriptionItem.php @@ -0,0 +1,152 @@ +cache_client.pubsub._SubscriptionItem + */ +class _SubscriptionItem extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Cache_client\Pubsub\_TopicItem $item + * The subscription has yielded an item you previously published. + * @type \Cache_client\Pubsub\_Discontinuity $discontinuity + * Momento wants to let you know we detected some possible inconsistency at this + * point in the subscription stream. + * A lack of a discontinuity does not mean the subscription is guaranteed to be + * strictly perfect, but the presence of a discontinuity is very likely to + * @type \Cache_client\Pubsub\_Heartbeat $heartbeat + * The stream is still working, there's nothing to see here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + + /** + * The subscription has yielded an item you previously published. + * + * Generated from protobuf field .cache_client.pubsub._TopicItem item = 1; + * @return \Cache_client\Pubsub\_TopicItem|null + */ + public function getItem() + { + return $this->readOneof(1); + } + + public function hasItem() + { + return $this->hasOneof(1); + } + + /** + * The subscription has yielded an item you previously published. + * + * Generated from protobuf field .cache_client.pubsub._TopicItem item = 1; + * @param \Cache_client\Pubsub\_TopicItem $var + * @return $this + */ + public function setItem($var) + { + GPBUtil::checkMessage($var, \Cache_client\Pubsub\_TopicItem::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Momento wants to let you know we detected some possible inconsistency at this + * point in the subscription stream. + * A lack of a discontinuity does not mean the subscription is guaranteed to be + * strictly perfect, but the presence of a discontinuity is very likely to + * + * Generated from protobuf field .cache_client.pubsub._Discontinuity discontinuity = 2; + * @return \Cache_client\Pubsub\_Discontinuity|null + */ + public function getDiscontinuity() + { + return $this->readOneof(2); + } + + public function hasDiscontinuity() + { + return $this->hasOneof(2); + } + + /** + * Momento wants to let you know we detected some possible inconsistency at this + * point in the subscription stream. + * A lack of a discontinuity does not mean the subscription is guaranteed to be + * strictly perfect, but the presence of a discontinuity is very likely to + * + * Generated from protobuf field .cache_client.pubsub._Discontinuity discontinuity = 2; + * @param \Cache_client\Pubsub\_Discontinuity $var + * @return $this + */ + public function setDiscontinuity($var) + { + GPBUtil::checkMessage($var, \Cache_client\Pubsub\_Discontinuity::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The stream is still working, there's nothing to see here. + * + * Generated from protobuf field .cache_client.pubsub._Heartbeat heartbeat = 3; + * @return \Cache_client\Pubsub\_Heartbeat|null + */ + public function getHeartbeat() + { + return $this->readOneof(3); + } + + public function hasHeartbeat() + { + return $this->hasOneof(3); + } + + /** + * The stream is still working, there's nothing to see here. + * + * Generated from protobuf field .cache_client.pubsub._Heartbeat heartbeat = 3; + * @param \Cache_client\Pubsub\_Heartbeat $var + * @return $this + */ + public function setHeartbeat($var) + { + GPBUtil::checkMessage($var, \Cache_client\Pubsub\_Heartbeat::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/types/Cache_client/Pubsub/_SubscriptionRequest.php b/types/Cache_client/Pubsub/_SubscriptionRequest.php new file mode 100644 index 00000000..97fc8951 --- /dev/null +++ b/types/Cache_client/Pubsub/_SubscriptionRequest.php @@ -0,0 +1,151 @@ +cache_client.pubsub._SubscriptionRequest + */ +class _SubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Cache namespace for the topic to which you want to subscribe. + * + * Generated from protobuf field string cache_name = 1; + */ + protected $cache_name = ''; + /** + * The literal topic name to which you want to subscribe. + * + * Generated from protobuf field string topic = 2; + */ + protected $topic = ''; + /** + * --> Providing this is not required. <-- + * If provided, attempt to reconnect to the topic and replay messages starting from + * the provided sequence number. You may get a discontinuity if some (or all) of the + * messages are not available. + * If not provided (or 0), the subscription will begin with the latest messages. + * + * Generated from protobuf field uint64 resume_at_topic_sequence_number = 3; + */ + protected $resume_at_topic_sequence_number = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cache_name + * Cache namespace for the topic to which you want to subscribe. + * @type string $topic + * The literal topic name to which you want to subscribe. + * @type int|string $resume_at_topic_sequence_number + * --> Providing this is not required. <-- + * If provided, attempt to reconnect to the topic and replay messages starting from + * the provided sequence number. You may get a discontinuity if some (or all) of the + * messages are not available. + * If not provided (or 0), the subscription will begin with the latest messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + + /** + * Cache namespace for the topic to which you want to subscribe. + * + * Generated from protobuf field string cache_name = 1; + * @return string + */ + public function getCacheName() + { + return $this->cache_name; + } + + /** + * Cache namespace for the topic to which you want to subscribe. + * + * Generated from protobuf field string cache_name = 1; + * @param string $var + * @return $this + */ + public function setCacheName($var) + { + GPBUtil::checkString($var, True); + $this->cache_name = $var; + + return $this; + } + + /** + * The literal topic name to which you want to subscribe. + * + * Generated from protobuf field string topic = 2; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * The literal topic name to which you want to subscribe. + * + * Generated from protobuf field string topic = 2; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * --> Providing this is not required. <-- + * If provided, attempt to reconnect to the topic and replay messages starting from + * the provided sequence number. You may get a discontinuity if some (or all) of the + * messages are not available. + * If not provided (or 0), the subscription will begin with the latest messages. + * + * Generated from protobuf field uint64 resume_at_topic_sequence_number = 3; + * @return int|string + */ + public function getResumeAtTopicSequenceNumber() + { + return $this->resume_at_topic_sequence_number; + } + + /** + * --> Providing this is not required. <-- + * If provided, attempt to reconnect to the topic and replay messages starting from + * the provided sequence number. You may get a discontinuity if some (or all) of the + * messages are not available. + * If not provided (or 0), the subscription will begin with the latest messages. + * + * Generated from protobuf field uint64 resume_at_topic_sequence_number = 3; + * @param int|string $var + * @return $this + */ + public function setResumeAtTopicSequenceNumber($var) + { + GPBUtil::checkUint64($var); + $this->resume_at_topic_sequence_number = $var; + + return $this; + } + +} + diff --git a/types/Cache_client/Pubsub/_TopicItem.php b/types/Cache_client/Pubsub/_TopicItem.php new file mode 100644 index 00000000..2730dff6 --- /dev/null +++ b/types/Cache_client/Pubsub/_TopicItem.php @@ -0,0 +1,173 @@ +cache_client.pubsub._TopicItem + */ +class _TopicItem extends \Google\Protobuf\Internal\Message +{ + /** + * Topic sequence numbers are **best-effort** and **informational**. + * They are not transactional. + * They exist: + * * to help reconnect to an existing topic while trying to avoid missing items. + * * to facilitate richer monitoring and logging. + * * to provide a best-effort awareness of stream contiguity, or lack thereof, + * in case you need to know. + * You can safely ignore them if none of that matters to you! + * + * Generated from protobuf field uint64 topic_sequence_number = 1; + */ + protected $topic_sequence_number = 0; + /** + * The value you previously published to this topic. + * + * Generated from protobuf field .cache_client.pubsub._TopicValue value = 2; + */ + protected $value = null; + /** + * Authenticated id from Publisher's disposable token + * + * Generated from protobuf field string publisher_id = 3; + */ + protected $publisher_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $topic_sequence_number + * Topic sequence numbers are **best-effort** and **informational**. + * They are not transactional. + * They exist: + * * to help reconnect to an existing topic while trying to avoid missing items. + * * to facilitate richer monitoring and logging. + * * to provide a best-effort awareness of stream contiguity, or lack thereof, + * in case you need to know. + * You can safely ignore them if none of that matters to you! + * @type \Cache_client\Pubsub\_TopicValue $value + * The value you previously published to this topic. + * @type string $publisher_id + * Authenticated id from Publisher's disposable token + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + + /** + * Topic sequence numbers are **best-effort** and **informational**. + * They are not transactional. + * They exist: + * * to help reconnect to an existing topic while trying to avoid missing items. + * * to facilitate richer monitoring and logging. + * * to provide a best-effort awareness of stream contiguity, or lack thereof, + * in case you need to know. + * You can safely ignore them if none of that matters to you! + * + * Generated from protobuf field uint64 topic_sequence_number = 1; + * @return int|string + */ + public function getTopicSequenceNumber() + { + return $this->topic_sequence_number; + } + + /** + * Topic sequence numbers are **best-effort** and **informational**. + * They are not transactional. + * They exist: + * * to help reconnect to an existing topic while trying to avoid missing items. + * * to facilitate richer monitoring and logging. + * * to provide a best-effort awareness of stream contiguity, or lack thereof, + * in case you need to know. + * You can safely ignore them if none of that matters to you! + * + * Generated from protobuf field uint64 topic_sequence_number = 1; + * @param int|string $var + * @return $this + */ + public function setTopicSequenceNumber($var) + { + GPBUtil::checkUint64($var); + $this->topic_sequence_number = $var; + + return $this; + } + + /** + * The value you previously published to this topic. + * + * Generated from protobuf field .cache_client.pubsub._TopicValue value = 2; + * @return \Cache_client\Pubsub\_TopicValue|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value you previously published to this topic. + * + * Generated from protobuf field .cache_client.pubsub._TopicValue value = 2; + * @param \Cache_client\Pubsub\_TopicValue $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Cache_client\Pubsub\_TopicValue::class); + $this->value = $var; + + return $this; + } + + /** + * Authenticated id from Publisher's disposable token + * + * Generated from protobuf field string publisher_id = 3; + * @return string + */ + public function getPublisherId() + { + return $this->publisher_id; + } + + /** + * Authenticated id from Publisher's disposable token + * + * Generated from protobuf field string publisher_id = 3; + * @param string $var + * @return $this + */ + public function setPublisherId($var) + { + GPBUtil::checkString($var, True); + $this->publisher_id = $var; + + return $this; + } + +} + diff --git a/types/Cache_client/Pubsub/_TopicValue.php b/types/Cache_client/Pubsub/_TopicValue.php new file mode 100644 index 00000000..8f519b0d --- /dev/null +++ b/types/Cache_client/Pubsub/_TopicValue.php @@ -0,0 +1,98 @@ +cache_client.pubsub._TopicValue + */ +class _TopicValue extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * @type string $binary + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cachepubsub::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->readOneof(1); + } + + public function hasText() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field bytes binary = 2; + * @return string + */ + public function getBinary() + { + return $this->readOneof(2); + } + + public function hasBinary() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field bytes binary = 2; + * @param string $var + * @return $this + */ + public function setBinary($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + diff --git a/types/Cache_client/ScsClient.php b/types/Cache_client/ScsClient.php index 743dafb1..ef0dd4fc 100644 --- a/types/Cache_client/ScsClient.php +++ b/types/Cache_client/ScsClient.php @@ -296,6 +296,20 @@ public function SetLength(\Cache_client\_SetLengthRequest $argument, $metadata, $options); } + /** + * @param \Cache_client\_SetPopRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetPop(\Cache_client\_SetPopRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/cache_client.Scs/SetPop', + $argument, + ['\Cache_client\_SetPopResponse', 'decode'], + $metadata, $options); + } + /** * @param \Cache_client\_ListPushFrontRequest $argument input argument * @param array $metadata metadata @@ -555,4 +569,34 @@ public function SortedSetGetRank(\Cache_client\_SortedSetGetRankRequest $argumen $metadata, $options); } + /** + * Returns length of the sorted set + * @param \Cache_client\_SortedSetLengthRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SortedSetLength(\Cache_client\_SortedSetLengthRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/cache_client.Scs/SortedSetLength', + $argument, + ['\Cache_client\_SortedSetLengthResponse', 'decode'], + $metadata, $options); + } + + /** + * Returns number of elements in the sorted set between a given min and max score + * @param \Cache_client\_SortedSetLengthByScoreRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SortedSetLengthByScore(\Cache_client\_SortedSetLengthByScoreRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/cache_client.Scs/SortedSetLengthByScore', + $argument, + ['\Cache_client\_SortedSetLengthByScoreResponse', 'decode'], + $metadata, $options); + } + } diff --git a/types/Cache_client/_SetPopRequest.php b/types/Cache_client/_SetPopRequest.php new file mode 100644 index 00000000..0ca74d2d --- /dev/null +++ b/types/Cache_client/_SetPopRequest.php @@ -0,0 +1,85 @@ +cache_client._SetPopRequest + */ +class _SetPopRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bytes set_name = 1; + */ + protected $set_name = ''; + /** + * Generated from protobuf field uint32 count = 2; + */ + protected $count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $set_name + * @type int $count + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field bytes set_name = 1; + * @return string + */ + public function getSetName() + { + return $this->set_name; + } + + /** + * Generated from protobuf field bytes set_name = 1; + * @param string $var + * @return $this + */ + public function setSetName($var) + { + GPBUtil::checkString($var, False); + $this->set_name = $var; + + return $this; + } + + /** + * Generated from protobuf field uint32 count = 2; + * @return int + */ + public function getCount() + { + return $this->count; + } + + /** + * Generated from protobuf field uint32 count = 2; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkUint32($var); + $this->count = $var; + + return $this; + } + +} + diff --git a/types/Cache_client/_SetPopResponse.php b/types/Cache_client/_SetPopResponse.php new file mode 100644 index 00000000..4a8cc524 --- /dev/null +++ b/types/Cache_client/_SetPopResponse.php @@ -0,0 +1,96 @@ +cache_client._SetPopResponse + */ +class _SetPopResponse extends \Google\Protobuf\Internal\Message +{ + protected $set; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Cache_client\_SetPopResponse\_Found $found + * @type \Cache_client\_SetPopResponse\_Missing $missing + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .cache_client._SetPopResponse._Found found = 1; + * @return \Cache_client\_SetPopResponse\_Found|null + */ + public function getFound() + { + return $this->readOneof(1); + } + + public function hasFound() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .cache_client._SetPopResponse._Found found = 1; + * @param \Cache_client\_SetPopResponse\_Found $var + * @return $this + */ + public function setFound($var) + { + GPBUtil::checkMessage($var, \Cache_client\_SetPopResponse\_Found::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field .cache_client._SetPopResponse._Missing missing = 2; + * @return \Cache_client\_SetPopResponse\_Missing|null + */ + public function getMissing() + { + return $this->readOneof(2); + } + + public function hasMissing() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field .cache_client._SetPopResponse._Missing missing = 2; + * @param \Cache_client\_SetPopResponse\_Missing $var + * @return $this + */ + public function setMissing($var) + { + GPBUtil::checkMessage($var, \Cache_client\_SetPopResponse\_Missing::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSet() + { + return $this->whichOneof("set"); + } + +} + diff --git a/types/Cache_client/_SetPopResponse/_Found.php b/types/Cache_client/_SetPopResponse/_Found.php new file mode 100644 index 00000000..91a870b3 --- /dev/null +++ b/types/Cache_client/_SetPopResponse/_Found.php @@ -0,0 +1,61 @@ +cache_client._SetPopResponse._Found + */ +class _Found extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated bytes elements = 1; + */ + private $elements; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string[]|\Google\Protobuf\Internal\RepeatedField $elements + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated bytes elements = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getElements() + { + return $this->elements; + } + + /** + * Generated from protobuf field repeated bytes elements = 1; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setElements($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); + $this->elements = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_Found::class, \Cache_client\_SetPopResponse__Found::class); + diff --git a/types/Cache_client/_SetPopResponse/_Missing.php b/types/Cache_client/_SetPopResponse/_Missing.php new file mode 100644 index 00000000..4850573f --- /dev/null +++ b/types/Cache_client/_SetPopResponse/_Missing.php @@ -0,0 +1,34 @@ +cache_client._SetPopResponse._Missing + */ +class _Missing extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_Missing::class, \Cache_client\_SetPopResponse__Missing::class); + diff --git a/types/Cache_client/_SetPopResponse__Found.php b/types/Cache_client/_SetPopResponse__Found.php new file mode 100644 index 00000000..5577b165 --- /dev/null +++ b/types/Cache_client/_SetPopResponse__Found.php @@ -0,0 +1,16 @@ +cache_client._SortedSetLengthByScoreRequest + */ +class _SortedSetLengthByScoreRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bytes set_name = 1; + */ + protected $set_name = ''; + protected $min; + protected $max; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $set_name + * @type float $inclusive_min + * @type float $exclusive_min + * @type \Cache_client\_Unbounded $unbounded_min + * @type float $inclusive_max + * @type float $exclusive_max + * @type \Cache_client\_Unbounded $unbounded_max + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field bytes set_name = 1; + * @return string + */ + public function getSetName() + { + return $this->set_name; + } + + /** + * Generated from protobuf field bytes set_name = 1; + * @param string $var + * @return $this + */ + public function setSetName($var) + { + GPBUtil::checkString($var, False); + $this->set_name = $var; + + return $this; + } + + /** + * Generated from protobuf field double inclusive_min = 2; + * @return float + */ + public function getInclusiveMin() + { + return $this->readOneof(2); + } + + public function hasInclusiveMin() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field double inclusive_min = 2; + * @param float $var + * @return $this + */ + public function setInclusiveMin($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Generated from protobuf field double exclusive_min = 3; + * @return float + */ + public function getExclusiveMin() + { + return $this->readOneof(3); + } + + public function hasExclusiveMin() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field double exclusive_min = 3; + * @param float $var + * @return $this + */ + public function setExclusiveMin($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Generated from protobuf field .cache_client._Unbounded unbounded_min = 4; + * @return \Cache_client\_Unbounded|null + */ + public function getUnboundedMin() + { + return $this->readOneof(4); + } + + public function hasUnboundedMin() + { + return $this->hasOneof(4); + } + + /** + * Generated from protobuf field .cache_client._Unbounded unbounded_min = 4; + * @param \Cache_client\_Unbounded $var + * @return $this + */ + public function setUnboundedMin($var) + { + GPBUtil::checkMessage($var, \Cache_client\_Unbounded::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Generated from protobuf field double inclusive_max = 5; + * @return float + */ + public function getInclusiveMax() + { + return $this->readOneof(5); + } + + public function hasInclusiveMax() + { + return $this->hasOneof(5); + } + + /** + * Generated from protobuf field double inclusive_max = 5; + * @param float $var + * @return $this + */ + public function setInclusiveMax($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Generated from protobuf field double exclusive_max = 6; + * @return float + */ + public function getExclusiveMax() + { + return $this->readOneof(6); + } + + public function hasExclusiveMax() + { + return $this->hasOneof(6); + } + + /** + * Generated from protobuf field double exclusive_max = 6; + * @param float $var + * @return $this + */ + public function setExclusiveMax($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Generated from protobuf field .cache_client._Unbounded unbounded_max = 7; + * @return \Cache_client\_Unbounded|null + */ + public function getUnboundedMax() + { + return $this->readOneof(7); + } + + public function hasUnboundedMax() + { + return $this->hasOneof(7); + } + + /** + * Generated from protobuf field .cache_client._Unbounded unbounded_max = 7; + * @param \Cache_client\_Unbounded $var + * @return $this + */ + public function setUnboundedMax($var) + { + GPBUtil::checkMessage($var, \Cache_client\_Unbounded::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getMin() + { + return $this->whichOneof("min"); + } + + /** + * @return string + */ + public function getMax() + { + return $this->whichOneof("max"); + } + +} + diff --git a/types/Cache_client/_SortedSetLengthByScoreResponse.php b/types/Cache_client/_SortedSetLengthByScoreResponse.php new file mode 100644 index 00000000..c80dc7af --- /dev/null +++ b/types/Cache_client/_SortedSetLengthByScoreResponse.php @@ -0,0 +1,96 @@ +cache_client._SortedSetLengthByScoreResponse + */ +class _SortedSetLengthByScoreResponse extends \Google\Protobuf\Internal\Message +{ + protected $sorted_set; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Cache_client\_SortedSetLengthByScoreResponse\_Found $found + * @type \Cache_client\_SortedSetLengthByScoreResponse\_Missing $missing + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthByScoreResponse._Found found = 1; + * @return \Cache_client\_SortedSetLengthByScoreResponse\_Found|null + */ + public function getFound() + { + return $this->readOneof(1); + } + + public function hasFound() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthByScoreResponse._Found found = 1; + * @param \Cache_client\_SortedSetLengthByScoreResponse\_Found $var + * @return $this + */ + public function setFound($var) + { + GPBUtil::checkMessage($var, \Cache_client\_SortedSetLengthByScoreResponse\_Found::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthByScoreResponse._Missing missing = 2; + * @return \Cache_client\_SortedSetLengthByScoreResponse\_Missing|null + */ + public function getMissing() + { + return $this->readOneof(2); + } + + public function hasMissing() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthByScoreResponse._Missing missing = 2; + * @param \Cache_client\_SortedSetLengthByScoreResponse\_Missing $var + * @return $this + */ + public function setMissing($var) + { + GPBUtil::checkMessage($var, \Cache_client\_SortedSetLengthByScoreResponse\_Missing::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSortedSet() + { + return $this->whichOneof("sorted_set"); + } + +} + diff --git a/types/Cache_client/_SortedSetLengthByScoreResponse/_Found.php b/types/Cache_client/_SortedSetLengthByScoreResponse/_Found.php new file mode 100644 index 00000000..e28b8df0 --- /dev/null +++ b/types/Cache_client/_SortedSetLengthByScoreResponse/_Found.php @@ -0,0 +1,61 @@ +cache_client._SortedSetLengthByScoreResponse._Found + */ +class _Found extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field uint32 length = 1; + */ + protected $length = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $length + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field uint32 length = 1; + * @return int + */ + public function getLength() + { + return $this->length; + } + + /** + * Generated from protobuf field uint32 length = 1; + * @param int $var + * @return $this + */ + public function setLength($var) + { + GPBUtil::checkUint32($var); + $this->length = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_Found::class, \Cache_client\_SortedSetLengthByScoreResponse__Found::class); + diff --git a/types/Cache_client/_SortedSetLengthByScoreResponse/_Missing.php b/types/Cache_client/_SortedSetLengthByScoreResponse/_Missing.php new file mode 100644 index 00000000..40c63e9e --- /dev/null +++ b/types/Cache_client/_SortedSetLengthByScoreResponse/_Missing.php @@ -0,0 +1,34 @@ +cache_client._SortedSetLengthByScoreResponse._Missing + */ +class _Missing extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_Missing::class, \Cache_client\_SortedSetLengthByScoreResponse__Missing::class); + diff --git a/types/Cache_client/_SortedSetLengthByScoreResponse__Found.php b/types/Cache_client/_SortedSetLengthByScoreResponse__Found.php new file mode 100644 index 00000000..6bcd8144 --- /dev/null +++ b/types/Cache_client/_SortedSetLengthByScoreResponse__Found.php @@ -0,0 +1,16 @@ +cache_client._SortedSetLengthRequest + */ +class _SortedSetLengthRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field bytes set_name = 1; + */ + protected $set_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $set_name + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field bytes set_name = 1; + * @return string + */ + public function getSetName() + { + return $this->set_name; + } + + /** + * Generated from protobuf field bytes set_name = 1; + * @param string $var + * @return $this + */ + public function setSetName($var) + { + GPBUtil::checkString($var, False); + $this->set_name = $var; + + return $this; + } + +} + diff --git a/types/Cache_client/_SortedSetLengthResponse.php b/types/Cache_client/_SortedSetLengthResponse.php new file mode 100644 index 00000000..b8b7d717 --- /dev/null +++ b/types/Cache_client/_SortedSetLengthResponse.php @@ -0,0 +1,96 @@ +cache_client._SortedSetLengthResponse + */ +class _SortedSetLengthResponse extends \Google\Protobuf\Internal\Message +{ + protected $sorted_set; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Cache_client\_SortedSetLengthResponse\_Found $found + * @type \Cache_client\_SortedSetLengthResponse\_Missing $missing + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthResponse._Found found = 1; + * @return \Cache_client\_SortedSetLengthResponse\_Found|null + */ + public function getFound() + { + return $this->readOneof(1); + } + + public function hasFound() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthResponse._Found found = 1; + * @param \Cache_client\_SortedSetLengthResponse\_Found $var + * @return $this + */ + public function setFound($var) + { + GPBUtil::checkMessage($var, \Cache_client\_SortedSetLengthResponse\_Found::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthResponse._Missing missing = 2; + * @return \Cache_client\_SortedSetLengthResponse\_Missing|null + */ + public function getMissing() + { + return $this->readOneof(2); + } + + public function hasMissing() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field .cache_client._SortedSetLengthResponse._Missing missing = 2; + * @param \Cache_client\_SortedSetLengthResponse\_Missing $var + * @return $this + */ + public function setMissing($var) + { + GPBUtil::checkMessage($var, \Cache_client\_SortedSetLengthResponse\_Missing::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getSortedSet() + { + return $this->whichOneof("sorted_set"); + } + +} + diff --git a/types/Cache_client/_SortedSetLengthResponse/_Found.php b/types/Cache_client/_SortedSetLengthResponse/_Found.php new file mode 100644 index 00000000..f798b7de --- /dev/null +++ b/types/Cache_client/_SortedSetLengthResponse/_Found.php @@ -0,0 +1,61 @@ +cache_client._SortedSetLengthResponse._Found + */ +class _Found extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field uint32 length = 1; + */ + protected $length = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $length + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field uint32 length = 1; + * @return int + */ + public function getLength() + { + return $this->length; + } + + /** + * Generated from protobuf field uint32 length = 1; + * @param int $var + * @return $this + */ + public function setLength($var) + { + GPBUtil::checkUint32($var); + $this->length = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_Found::class, \Cache_client\_SortedSetLengthResponse__Found::class); + diff --git a/types/Cache_client/_SortedSetLengthResponse/_Missing.php b/types/Cache_client/_SortedSetLengthResponse/_Missing.php new file mode 100644 index 00000000..0bb0bb32 --- /dev/null +++ b/types/Cache_client/_SortedSetLengthResponse/_Missing.php @@ -0,0 +1,34 @@ +cache_client._SortedSetLengthResponse._Missing + */ +class _Missing extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Cacheclient::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_Missing::class, \Cache_client\_SortedSetLengthResponse__Missing::class); + diff --git a/types/Cache_client/_SortedSetLengthResponse__Found.php b/types/Cache_client/_SortedSetLengthResponse__Found.php new file mode 100644 index 00000000..731e4362 --- /dev/null +++ b/types/Cache_client/_SortedSetLengthResponse__Found.php @@ -0,0 +1,16 @@ +_simpleRequest('/control_client.ScsControl/CreateIndex', + $argument, + ['\Control_client\_CreateIndexResponse', 'decode'], + $metadata, $options); + } + + /** + * @param \Control_client\_DeleteIndexRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteIndex(\Control_client\_DeleteIndexRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/control_client.ScsControl/DeleteIndex', + $argument, + ['\Control_client\_DeleteIndexResponse', 'decode'], + $metadata, $options); + } + + /** + * @param \Control_client\_ListIndexesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListIndexes(\Control_client\_ListIndexesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/control_client.ScsControl/ListIndexes', + $argument, + ['\Control_client\_ListIndexesResponse', 'decode'], + $metadata, $options); + } + } diff --git a/types/Control_client/_Cache.php b/types/Control_client/_Cache.php index 8a4b77d4..ae0b344d 100644 --- a/types/Control_client/_Cache.php +++ b/types/Control_client/_Cache.php @@ -17,6 +17,14 @@ class _Cache extends \Google\Protobuf\Internal\Message * Generated from protobuf field string cache_name = 1; */ protected $cache_name = ''; + /** + * Generated from protobuf field .control_client._CacheLimits cache_limits = 2; + */ + protected $cache_limits = null; + /** + * Generated from protobuf field .control_client._TopicLimits topic_limits = 3; + */ + protected $topic_limits = null; /** * Constructor. @@ -25,6 +33,8 @@ class _Cache extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $cache_name + * @type \Control_client\_CacheLimits $cache_limits + * @type \Control_client\_TopicLimits $topic_limits * } */ public function __construct($data = NULL) { @@ -54,5 +64,69 @@ public function setCacheName($var) return $this; } + /** + * Generated from protobuf field .control_client._CacheLimits cache_limits = 2; + * @return \Control_client\_CacheLimits|null + */ + public function getCacheLimits() + { + return $this->cache_limits; + } + + public function hasCacheLimits() + { + return isset($this->cache_limits); + } + + public function clearCacheLimits() + { + unset($this->cache_limits); + } + + /** + * Generated from protobuf field .control_client._CacheLimits cache_limits = 2; + * @param \Control_client\_CacheLimits $var + * @return $this + */ + public function setCacheLimits($var) + { + GPBUtil::checkMessage($var, \Control_client\_CacheLimits::class); + $this->cache_limits = $var; + + return $this; + } + + /** + * Generated from protobuf field .control_client._TopicLimits topic_limits = 3; + * @return \Control_client\_TopicLimits|null + */ + public function getTopicLimits() + { + return $this->topic_limits; + } + + public function hasTopicLimits() + { + return isset($this->topic_limits); + } + + public function clearTopicLimits() + { + unset($this->topic_limits); + } + + /** + * Generated from protobuf field .control_client._TopicLimits topic_limits = 3; + * @param \Control_client\_TopicLimits $var + * @return $this + */ + public function setTopicLimits($var) + { + GPBUtil::checkMessage($var, \Control_client\_TopicLimits::class); + $this->topic_limits = $var; + + return $this; + } + } diff --git a/types/Control_client/_CacheLimits.php b/types/Control_client/_CacheLimits.php new file mode 100644 index 00000000..1b4decb7 --- /dev/null +++ b/types/Control_client/_CacheLimits.php @@ -0,0 +1,167 @@ +control_client._CacheLimits + */ +class _CacheLimits extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of transactions per second that can be exercised + * + * Generated from protobuf field uint32 max_traffic_rate = 1; + */ + protected $max_traffic_rate = 0; + /** + * The amount of traffic per second that can be exercised in KiB + * + * Generated from protobuf field uint32 max_throughput_kbps = 2; + */ + protected $max_throughput_kbps = 0; + /** + * The maximum size of a single item in KiB + * + * Generated from protobuf field uint32 max_item_size_kb = 3; + */ + protected $max_item_size_kb = 0; + /** + * The maximum TTL allowed for a single item, in seconds + * + * Generated from protobuf field uint64 max_ttl_seconds = 4; + */ + protected $max_ttl_seconds = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_traffic_rate + * The amount of transactions per second that can be exercised + * @type int $max_throughput_kbps + * The amount of traffic per second that can be exercised in KiB + * @type int $max_item_size_kb + * The maximum size of a single item in KiB + * @type int|string $max_ttl_seconds + * The maximum TTL allowed for a single item, in seconds + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + + /** + * The amount of transactions per second that can be exercised + * + * Generated from protobuf field uint32 max_traffic_rate = 1; + * @return int + */ + public function getMaxTrafficRate() + { + return $this->max_traffic_rate; + } + + /** + * The amount of transactions per second that can be exercised + * + * Generated from protobuf field uint32 max_traffic_rate = 1; + * @param int $var + * @return $this + */ + public function setMaxTrafficRate($var) + { + GPBUtil::checkUint32($var); + $this->max_traffic_rate = $var; + + return $this; + } + + /** + * The amount of traffic per second that can be exercised in KiB + * + * Generated from protobuf field uint32 max_throughput_kbps = 2; + * @return int + */ + public function getMaxThroughputKbps() + { + return $this->max_throughput_kbps; + } + + /** + * The amount of traffic per second that can be exercised in KiB + * + * Generated from protobuf field uint32 max_throughput_kbps = 2; + * @param int $var + * @return $this + */ + public function setMaxThroughputKbps($var) + { + GPBUtil::checkUint32($var); + $this->max_throughput_kbps = $var; + + return $this; + } + + /** + * The maximum size of a single item in KiB + * + * Generated from protobuf field uint32 max_item_size_kb = 3; + * @return int + */ + public function getMaxItemSizeKb() + { + return $this->max_item_size_kb; + } + + /** + * The maximum size of a single item in KiB + * + * Generated from protobuf field uint32 max_item_size_kb = 3; + * @param int $var + * @return $this + */ + public function setMaxItemSizeKb($var) + { + GPBUtil::checkUint32($var); + $this->max_item_size_kb = $var; + + return $this; + } + + /** + * The maximum TTL allowed for a single item, in seconds + * + * Generated from protobuf field uint64 max_ttl_seconds = 4; + * @return int|string + */ + public function getMaxTtlSeconds() + { + return $this->max_ttl_seconds; + } + + /** + * The maximum TTL allowed for a single item, in seconds + * + * Generated from protobuf field uint64 max_ttl_seconds = 4; + * @param int|string $var + * @return $this + */ + public function setMaxTtlSeconds($var) + { + GPBUtil::checkUint64($var); + $this->max_ttl_seconds = $var; + + return $this; + } + +} + diff --git a/types/Control_client/_CreateIndexRequest.php b/types/Control_client/_CreateIndexRequest.php new file mode 100644 index 00000000..40f6e099 --- /dev/null +++ b/types/Control_client/_CreateIndexRequest.php @@ -0,0 +1,122 @@ +control_client._CreateIndexRequest + */ +class _CreateIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string index_name = 1; + */ + protected $index_name = ''; + /** + * Generated from protobuf field uint64 num_dimensions = 2; + */ + protected $num_dimensions = 0; + /** + * Generated from protobuf field .control_client._SimilarityMetric similarity_metric = 3; + */ + protected $similarity_metric = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $index_name + * @type int|string $num_dimensions + * @type \Control_client\_SimilarityMetric $similarity_metric + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string index_name = 1; + * @return string + */ + public function getIndexName() + { + return $this->index_name; + } + + /** + * Generated from protobuf field string index_name = 1; + * @param string $var + * @return $this + */ + public function setIndexName($var) + { + GPBUtil::checkString($var, True); + $this->index_name = $var; + + return $this; + } + + /** + * Generated from protobuf field uint64 num_dimensions = 2; + * @return int|string + */ + public function getNumDimensions() + { + return $this->num_dimensions; + } + + /** + * Generated from protobuf field uint64 num_dimensions = 2; + * @param int|string $var + * @return $this + */ + public function setNumDimensions($var) + { + GPBUtil::checkUint64($var); + $this->num_dimensions = $var; + + return $this; + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric similarity_metric = 3; + * @return \Control_client\_SimilarityMetric|null + */ + public function getSimilarityMetric() + { + return $this->similarity_metric; + } + + public function hasSimilarityMetric() + { + return isset($this->similarity_metric); + } + + public function clearSimilarityMetric() + { + unset($this->similarity_metric); + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric similarity_metric = 3; + * @param \Control_client\_SimilarityMetric $var + * @return $this + */ + public function setSimilarityMetric($var) + { + GPBUtil::checkMessage($var, \Control_client\_SimilarityMetric::class); + $this->similarity_metric = $var; + + return $this; + } + +} + diff --git a/types/Control_client/_CreateIndexResponse.php b/types/Control_client/_CreateIndexResponse.php new file mode 100644 index 00000000..d9ca9235 --- /dev/null +++ b/types/Control_client/_CreateIndexResponse.php @@ -0,0 +1,31 @@ +control_client._CreateIndexResponse + */ +class _CreateIndexResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + +} + diff --git a/types/Control_client/_DeleteIndexRequest.php b/types/Control_client/_DeleteIndexRequest.php new file mode 100644 index 00000000..592ec90d --- /dev/null +++ b/types/Control_client/_DeleteIndexRequest.php @@ -0,0 +1,58 @@ +control_client._DeleteIndexRequest + */ +class _DeleteIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string index_name = 1; + */ + protected $index_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $index_name + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string index_name = 1; + * @return string + */ + public function getIndexName() + { + return $this->index_name; + } + + /** + * Generated from protobuf field string index_name = 1; + * @param string $var + * @return $this + */ + public function setIndexName($var) + { + GPBUtil::checkString($var, True); + $this->index_name = $var; + + return $this; + } + +} + diff --git a/types/Control_client/_DeleteIndexResponse.php b/types/Control_client/_DeleteIndexResponse.php new file mode 100644 index 00000000..3b943a8a --- /dev/null +++ b/types/Control_client/_DeleteIndexResponse.php @@ -0,0 +1,31 @@ +control_client._DeleteIndexResponse + */ +class _DeleteIndexResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + +} + diff --git a/types/Control_client/_ListIndexesRequest.php b/types/Control_client/_ListIndexesRequest.php new file mode 100644 index 00000000..47ce088d --- /dev/null +++ b/types/Control_client/_ListIndexesRequest.php @@ -0,0 +1,31 @@ +control_client._ListIndexesRequest + */ +class _ListIndexesRequest extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + +} + diff --git a/types/Control_client/_ListIndexesResponse.php b/types/Control_client/_ListIndexesResponse.php new file mode 100644 index 00000000..9111731a --- /dev/null +++ b/types/Control_client/_ListIndexesResponse.php @@ -0,0 +1,58 @@ +control_client._ListIndexesResponse + */ +class _ListIndexesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .control_client._ListIndexesResponse._Index indexes = 1; + */ + private $indexes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Control_client\_ListIndexesResponse\_Index[]|\Google\Protobuf\Internal\RepeatedField $indexes + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .control_client._ListIndexesResponse._Index indexes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexes() + { + return $this->indexes; + } + + /** + * Generated from protobuf field repeated .control_client._ListIndexesResponse._Index indexes = 1; + * @param \Control_client\_ListIndexesResponse\_Index[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Control_client\_ListIndexesResponse\_Index::class); + $this->indexes = $arr; + + return $this; + } + +} + diff --git a/types/Control_client/_ListIndexesResponse/_Index.php b/types/Control_client/_ListIndexesResponse/_Index.php new file mode 100644 index 00000000..1b2deb94 --- /dev/null +++ b/types/Control_client/_ListIndexesResponse/_Index.php @@ -0,0 +1,125 @@ +control_client._ListIndexesResponse._Index + */ +class _Index extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string index_name = 1; + */ + protected $index_name = ''; + /** + * Generated from protobuf field uint64 num_dimensions = 2; + */ + protected $num_dimensions = 0; + /** + * Generated from protobuf field .control_client._SimilarityMetric similarity_metric = 3; + */ + protected $similarity_metric = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $index_name + * @type int|string $num_dimensions + * @type \Control_client\_SimilarityMetric $similarity_metric + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string index_name = 1; + * @return string + */ + public function getIndexName() + { + return $this->index_name; + } + + /** + * Generated from protobuf field string index_name = 1; + * @param string $var + * @return $this + */ + public function setIndexName($var) + { + GPBUtil::checkString($var, True); + $this->index_name = $var; + + return $this; + } + + /** + * Generated from protobuf field uint64 num_dimensions = 2; + * @return int|string + */ + public function getNumDimensions() + { + return $this->num_dimensions; + } + + /** + * Generated from protobuf field uint64 num_dimensions = 2; + * @param int|string $var + * @return $this + */ + public function setNumDimensions($var) + { + GPBUtil::checkUint64($var); + $this->num_dimensions = $var; + + return $this; + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric similarity_metric = 3; + * @return \Control_client\_SimilarityMetric|null + */ + public function getSimilarityMetric() + { + return $this->similarity_metric; + } + + public function hasSimilarityMetric() + { + return isset($this->similarity_metric); + } + + public function clearSimilarityMetric() + { + unset($this->similarity_metric); + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric similarity_metric = 3; + * @param \Control_client\_SimilarityMetric $var + * @return $this + */ + public function setSimilarityMetric($var) + { + GPBUtil::checkMessage($var, \Control_client\_SimilarityMetric::class); + $this->similarity_metric = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_Index::class, \Control_client\_ListIndexesResponse__Index::class); + diff --git a/types/Control_client/_ListIndexesResponse__Index.php b/types/Control_client/_ListIndexesResponse__Index.php new file mode 100644 index 00000000..e1f72919 --- /dev/null +++ b/types/Control_client/_ListIndexesResponse__Index.php @@ -0,0 +1,16 @@ +control_client._SimilarityMetric + */ +class _SimilarityMetric extends \Google\Protobuf\Internal\Message +{ + protected $similarity_metric; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Control_client\_SimilarityMetric\_EuclideanSimilarity $euclidean_similarity + * @type \Control_client\_SimilarityMetric\_InnerProduct $inner_product + * @type \Control_client\_SimilarityMetric\_CosineSimilarity $cosine_similarity + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric._EuclideanSimilarity euclidean_similarity = 1; + * @return \Control_client\_SimilarityMetric\_EuclideanSimilarity|null + */ + public function getEuclideanSimilarity() + { + return $this->readOneof(1); + } + + public function hasEuclideanSimilarity() + { + return $this->hasOneof(1); + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric._EuclideanSimilarity euclidean_similarity = 1; + * @param \Control_client\_SimilarityMetric\_EuclideanSimilarity $var + * @return $this + */ + public function setEuclideanSimilarity($var) + { + GPBUtil::checkMessage($var, \Control_client\_SimilarityMetric\_EuclideanSimilarity::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric._InnerProduct inner_product = 2; + * @return \Control_client\_SimilarityMetric\_InnerProduct|null + */ + public function getInnerProduct() + { + return $this->readOneof(2); + } + + public function hasInnerProduct() + { + return $this->hasOneof(2); + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric._InnerProduct inner_product = 2; + * @param \Control_client\_SimilarityMetric\_InnerProduct $var + * @return $this + */ + public function setInnerProduct($var) + { + GPBUtil::checkMessage($var, \Control_client\_SimilarityMetric\_InnerProduct::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric._CosineSimilarity cosine_similarity = 3; + * @return \Control_client\_SimilarityMetric\_CosineSimilarity|null + */ + public function getCosineSimilarity() + { + return $this->readOneof(3); + } + + public function hasCosineSimilarity() + { + return $this->hasOneof(3); + } + + /** + * Generated from protobuf field .control_client._SimilarityMetric._CosineSimilarity cosine_similarity = 3; + * @param \Control_client\_SimilarityMetric\_CosineSimilarity $var + * @return $this + */ + public function setCosineSimilarity($var) + { + GPBUtil::checkMessage($var, \Control_client\_SimilarityMetric\_CosineSimilarity::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getSimilarityMetric() + { + return $this->whichOneof("similarity_metric"); + } + +} + diff --git a/types/Control_client/_SimilarityMetric/_CosineSimilarity.php b/types/Control_client/_SimilarityMetric/_CosineSimilarity.php new file mode 100644 index 00000000..3349b208 --- /dev/null +++ b/types/Control_client/_SimilarityMetric/_CosineSimilarity.php @@ -0,0 +1,34 @@ +control_client._SimilarityMetric._CosineSimilarity + */ +class _CosineSimilarity extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_CosineSimilarity::class, \Control_client\_SimilarityMetric__CosineSimilarity::class); + diff --git a/types/Control_client/_SimilarityMetric/_EuclideanSimilarity.php b/types/Control_client/_SimilarityMetric/_EuclideanSimilarity.php new file mode 100644 index 00000000..234b4c8b --- /dev/null +++ b/types/Control_client/_SimilarityMetric/_EuclideanSimilarity.php @@ -0,0 +1,34 @@ +control_client._SimilarityMetric._EuclideanSimilarity + */ +class _EuclideanSimilarity extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_EuclideanSimilarity::class, \Control_client\_SimilarityMetric__EuclideanSimilarity::class); + diff --git a/types/Control_client/_SimilarityMetric/_InnerProduct.php b/types/Control_client/_SimilarityMetric/_InnerProduct.php new file mode 100644 index 00000000..efc466a6 --- /dev/null +++ b/types/Control_client/_SimilarityMetric/_InnerProduct.php @@ -0,0 +1,34 @@ +control_client._SimilarityMetric._InnerProduct + */ +class _InnerProduct extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(_InnerProduct::class, \Control_client\_SimilarityMetric__InnerProduct::class); + diff --git a/types/Control_client/_SimilarityMetric__CosineSimilarity.php b/types/Control_client/_SimilarityMetric__CosineSimilarity.php new file mode 100644 index 00000000..f4cb6646 --- /dev/null +++ b/types/Control_client/_SimilarityMetric__CosineSimilarity.php @@ -0,0 +1,16 @@ +control_client._TopicLimits + */ +class _TopicLimits extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of messages that can be published per second + * + * Generated from protobuf field uint32 max_publish_rate = 1; + */ + protected $max_publish_rate = 0; + /** + * The maximum amount of active subscriptions per cache + * + * Generated from protobuf field uint32 max_subscription_count = 2; + */ + protected $max_subscription_count = 0; + /** + * The maximum size of a single publish message, in KiB + * + * Generated from protobuf field uint32 max_publish_message_size_kb = 3; + */ + protected $max_publish_message_size_kb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_publish_rate + * The amount of messages that can be published per second + * @type int $max_subscription_count + * The maximum amount of active subscriptions per cache + * @type int $max_publish_message_size_kb + * The maximum size of a single publish message, in KiB + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Controlclient::initOnce(); + parent::__construct($data); + } + + /** + * The amount of messages that can be published per second + * + * Generated from protobuf field uint32 max_publish_rate = 1; + * @return int + */ + public function getMaxPublishRate() + { + return $this->max_publish_rate; + } + + /** + * The amount of messages that can be published per second + * + * Generated from protobuf field uint32 max_publish_rate = 1; + * @param int $var + * @return $this + */ + public function setMaxPublishRate($var) + { + GPBUtil::checkUint32($var); + $this->max_publish_rate = $var; + + return $this; + } + + /** + * The maximum amount of active subscriptions per cache + * + * Generated from protobuf field uint32 max_subscription_count = 2; + * @return int + */ + public function getMaxSubscriptionCount() + { + return $this->max_subscription_count; + } + + /** + * The maximum amount of active subscriptions per cache + * + * Generated from protobuf field uint32 max_subscription_count = 2; + * @param int $var + * @return $this + */ + public function setMaxSubscriptionCount($var) + { + GPBUtil::checkUint32($var); + $this->max_subscription_count = $var; + + return $this; + } + + /** + * The maximum size of a single publish message, in KiB + * + * Generated from protobuf field uint32 max_publish_message_size_kb = 3; + * @return int + */ + public function getMaxPublishMessageSizeKb() + { + return $this->max_publish_message_size_kb; + } + + /** + * The maximum size of a single publish message, in KiB + * + * Generated from protobuf field uint32 max_publish_message_size_kb = 3; + * @param int $var + * @return $this + */ + public function setMaxPublishMessageSizeKb($var) + { + GPBUtil::checkUint32($var); + $this->max_publish_message_size_kb = $var; + + return $this; + } + +} + diff --git a/types/GPBMetadata/Auth.php b/types/GPBMetadata/Auth.php index a825e9c07996ba841c609903203e3555932ce15f..68a38fe26bd09c246dfe3e402d11528ffc1bb182 100644 GIT binary patch delta 180 zcmZn_InB4Bh*2lTJ;2E~wInemu_Q4jAhjqrv$!}jKQA}6xHvIAwb;rkGcU8mKQB2| zL(_V4CZh$@I^|(qXxH;f*wLF9%i5( z!j57g0WOY`{Or`c_{^|(qXxH; z*5rrG^4tLk@yXRJ`f5@u7`c!Ig*>^qic5jI<4cQEizFCkxD|vuLP?S2caj|4)=A}qQaS6LZwIC@Faz=GFqXIL~ z*?J(m9g&oUR2HO4y=CI!M-vl@iQy7VPE5{7jW0lW66^zRBYTi34rn^`oI$FQ1cAN* z8B&s8keQ5P2*h7tL)?(mgPful0#c16=)oZ6#U+4lw2&DWOHqDKDl|kjKXVw6UNYH% zTXV93CFf*4MTyB>+=^g!wxYx28Jc`zT})hZXzDYZDkoo1mv<58;?2xU&M7U_aT=JN14^GZ6N`(cbkSijf6;$PTzySjEAV|^V zgEGQGo=71Kw4B?>Y_g)I1TV6>RA7i(0RxM7vZ$^-(;1n~VY+wN6x_MkAh9MSqnDhR zoRJ!zoRgWFSE2_?39)(-P!*fiO=8(5dt35yK#Ubq1=+y{;Y_ZxRMdemVUAW}5Gv;q jgG4GU5}|HR719Ce6+>}fP-jW> delta 42 zcmV+_0M-A#fC0C5u&)6EuX3}o0h<%EG#1GhllCw_0;U?XH!<7>vs^e*29t|Fvw=ks AMgRZ+ diff --git a/types/GPBMetadata/Cachepubsub.php b/types/GPBMetadata/Cachepubsub.php new file mode 100644 index 0000000000000000000000000000000000000000..8deec3dc28fddfecb6a833f2b6111b2331317aa5 GIT binary patch literal 1581 zcmb7ET~8B16s1@yy#pHIWt>Jf#S!$?9S%gx#!$-?_GZu2Qkc%UF0aJ!UplqhzgLzB2tkbg~Usm zO%%kB+A#}JR0!EVB(DyS$j zhup{VB1!Kw*!eipN;XJ+H;P&z)@w$b7FOTq3I(TOeH*1OSgayZ)6i@U|38FE!g{VEMZ&fRIp>a27Ocift>K?bk! zBtfYhM;m6Wa*dtE49S%9&L|A2C}w_f&>ojz=mQNCEZ)+`!YZlsNm6l-OvGD*t7gA^ zFAkIfm~`Lhj@nkwk^o3cXsO?ad;L`#gR)v##}Q-DKRDt{!iXI|8K7`k!_v!_oQmPWMh zZar3iWFV&-RBsvQCEV_`sx#l;fXkgcHQgU&JKuQ^`A#o-=q&a}_G#9s2Y-he!&Wkz z0*WmW`~C2>%)6BqQ-R){debhqqqd&TC^%V8=X6Onj+a`|T6%Kz$!$g724@daT*WRl nS=lmUx|L3LS|cxKSMj5T?rwOP?x&u0cH=6u$aMXj!#Th&ld|+H literal 0 HcmV?d00001 diff --git a/types/GPBMetadata/Controlclient.php b/types/GPBMetadata/Controlclient.php index 5d85207f80c7ea0b7066476f5d957fa1e10a69c0..f16a6c851577f05dcf9fe68ac849d76d5c1ded17 100644 GIT binary patch literal 3495 zcmcgvT~8ZF6peu<%5@CMIt3S^YO_#b+G0{7^?{F8#UunZDONzO6d_I5>#;pzzp^u1 zK`PXj{+g;kB)_4*rgvu6_Sm~lcnU9gcg{Wc-ZN)rXZC)K`!THAM>M2~D`>}VU)iEh z?Kp`<=-Y2wixM1&%Ve9vbz6b%&* z5V`^7vFlO$sCDp)3b*45cNf6(UC!;M83KQTjel|4_L*mM;R^h>#yDXi6U_D5JFITs z?z%pw$dJc&)6f$v3T+v15_+`0VQWr_U5g{^X5T(PilUxR&s(xVZ0`Ix6f_B4|NM}0 zFJZBWk`_XDc6w9{Wsz^{8(CUO$GUc1*SNEjD{|i!NlMM^ww+LsCgHBCTM}Fkf2qng ze_&Z1KXp38w9irU`Vc6?*5ThJs1|5#&1Wx(o&o2-8F)ZWS-^ZZVd4tKPnc)@3J+ViETm?6vx@EM4cMA0)~s!L5gry*y}SSwVkTd%qGFTr2l#TN6A6@z&R9~mYNVe;X|Errf?Tv? z?YPPyj0qax+ImNEOc}0XEy02c6F%V-w}1|>&Eblha{|nK7RAgPS-ZwLU35$|~ zr)|B9qSJ{NrJ>#lD%L8j$nilWeipdflWW|l!}+^}Zcv>{9lVLju(size&;J4vOVTe z&Tghw7$al@B#Y52EFWWZ>9n#Hpm=a*GNXS5pQ-ej%@>RFPRyX(2k$ytP|KF zPEK^ca(7wD$vz4#)LyQ$=YGojYB~q17x>GOJD-WvWo*B{190l`rarA$Z=h@}XKOWA zk1?8MTVDGxC{z2EX zPA4`oLt+N^wU)*V*K>7GLIz1TZh$mXO)df}pK1~^Jyjk#Ox1;j3Bz0G>$zGdAcIW# znsUHlqM=dMm$tx6S~)d3;GbsH3}kW}XNLlAV{|(A7|7(7O{tWW7jPS+)49h$1MY)9 zRC`J6O~~CUy?N4OqMx>LAlM2bJgbSQ|8`5Cr8jx!VzU?R>L-Fvq!;}&^XQevHPl^# nH?j?)sct~++jtTd(bM(e@%>wUD=;n*Q!fw-sqYHca1HQ3t&)dC delta 57 zcmV-90LK5P8>SGjvjGCD43o71CI~4C6JJDSY-N){1t*dO29qlVdjTAikp>*I6$cOk P0<;CQCkeFzlkg0;>ID$x From 31e7d6279c92a09dd227bd2667ac297529d8092f Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 13:39:49 -0800 Subject: [PATCH 02/64] fix: renew protos --- examples/composer.json | 2 +- types/Cache_client/.DS_Store | Bin 6148 -> 0 bytes types/GPBMetadata/Extensions.php | Bin 0 -> 707 bytes types/RetrySemantic.php | 50 +++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) delete mode 100644 types/Cache_client/.DS_Store create mode 100644 types/GPBMetadata/Extensions.php create mode 100644 types/RetrySemantic.php diff --git a/examples/composer.json b/examples/composer.json index 7e7dfc22..dabf4ddb 100644 --- a/examples/composer.json +++ b/examples/composer.json @@ -1,6 +1,6 @@ { "require": { - "momentohq/client-sdk-php": "1.4.0", + "momentohq/client-sdk-php": "dev-feat/topic-poc", "monolog/monolog": "^2.5" } } diff --git a/types/Cache_client/.DS_Store b/types/Cache_client/.DS_Store deleted file mode 100644 index c4361cee4837152ef84a4ac05e011aa0894a25bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKF>V4u473vzA<DubPd`})N&zYG-xc8Zp}~p0a7c_#2Zm??fD?qnFppjW*cbrz z!XXh6m?ssORIe7pla6?+yk0mYCf&T653ifOIuwuFaej+*^PZ?t3P^!_1>SQxXZ>Hp zf9e14Nm@w(DezJX_++(RE%BtPt)s`W);9PToHMR5}|4~NZd9AR1_LWe+rH}n12CueqL*=LxdM#l+r$R2@K2-X=g!YIhBkaM9t}F9u=R zI#W`BCr)A8mwqX=B*~S03cAKnaOE+yzs44|78IDFX_#q&{X=MHHrRb@f{!sQrpA;C z7xTtiu(i0OsDjS^2XC2@2yrcad!tQs#rtN_J*RetrySemantic + */ +class RetrySemantic +{ + /** + * Never retry this message without telling the user. (you should infer this as the default) + * + * Generated from protobuf enum NotRetryable = 0; + */ + const NotRetryable = 0; + /** + * You can retry this without surfacing an error to the user. + * + * Generated from protobuf enum Retryable = 1; + */ + const Retryable = 1; + + private static $valueToName = [ + self::NotRetryable => 'NotRetryable', + self::Retryable => 'Retryable', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + From cd195295e8cc5d8805a481118010bf8969f0bd7d Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 13:52:29 -0800 Subject: [PATCH 03/64] fix: remove futureResponses for now --- examples/topic-example.php | 12 ++-- src/Topic/Internal/ScsTopicClient.php | 83 ++++++++++++++++++--------- src/Topic/TopicClient.php | 2 +- 3 files changed, 62 insertions(+), 35 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index b4638f34..92eae3bb 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -64,11 +64,11 @@ function printBanner(string $message, LoggerInterface $logger): void // Delete test cache -$logger->info("Deleting cache $CACHE_NAME\n"); -$response = $client->deleteCache($CACHE_NAME); -if ($response->asError()) { - $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); - exit(1); -} +//$logger->info("Deleting cache $CACHE_NAME\n"); +//$response = $client->deleteCache($CACHE_NAME); +//if ($response->asError()) { +// $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); +// exit(1); +//} printBanner("* Momento Example End *", $logger); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 7b53cd9d..2166c108 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -73,51 +73,78 @@ private function returnCollectionTtl(?CollectionTtl $ttl): CollectionTtl private function processCall(UnaryCall $call) { [$response, $status] = $call->wait(); + $this->logger->debug("response: . json_encode($response)\n"); if ($status->code !== 0) { - $this->logger->debug("Data client error: {$status->details}"); + $this->logger->debug("Topic client error: {$status->details}"); throw _ErrorConverter::convert($status->code, $status->details, $call->getMetadata()); } return $response; } - - /** - * @return ResponseFuture - */ - public function publish(string $cacheName, string $topicName, string $value): ResponseFuture + public function publish(string $cacheName, string $topicName, string $value): TopicPublishResponse { + $this->logger->info("Publishing to topic: $topicName in cache $cacheName\n"); $topicValue = new _TopicValue(); $topicValue->setText($value); try { validateCacheName($cacheName); - $publishRequest = new _PublishRequest(); - $publishRequest->setCacheName($cacheName); - $publishRequest->setTopic($topicName); - $publishRequest->setValue($topicValue); - - $call = $this->grpcManager->client->Publish($publishRequest,); + $request = new _PublishRequest(); + $request->setCacheName($cacheName); + $request->setTopic($topicName); + $request->setValue($topicValue); + $call = $this->grpcManager->client->Publish($request); + $this->processCall($call); } catch (SdkError $e) { $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); - return ResponseFuture::createResolved(new TopicPublishResponseError($e)); - } catch (Exception $e) { + return new TopicPublishResponseError($e); + } catch (\Exception $e) { $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); - return ResponseFuture::createResolved(new TopicPublishResponseError(new UnknownError($e->getMessage()))); + return new TopicPublishResponseError(new UnknownError($e->getMessage())); } + return new TopicPublishResponseSuccess(); + } - return ResponseFuture::createPending( - function () use ($call): TopicPublishResponse { - try { - $this->processCall($call); - } catch (SdkError $e) { - return new TopicPublishResponseError($e); - } catch (Exception $e) { - return new TopicPublishResponseError(new UnknownError($e->getMessage())); - } - return new TopicPublishResponseSuccess(); - } - ); - } +// /** +// * @return TopicPublishResponse +// */ +// public function publish(string $cacheName, string $topicName, string $value): TopicPublishResponse +// { +// $topicValue = new _TopicValue(); +// $topicValue->setText($value); +// try { +// $this->logger->info("Publishing to topic: $topicName in cache $cacheName\n"); +// validateCacheName($cacheName); +// $publishRequest = new _PublishRequest(); +// $publishRequest->setCacheName($cacheName); +// $publishRequest->setTopic($topicName); +// $publishRequest->setValue($topicValue); +// $this->logger->debug("publishRequest: . json_encode($publishRequest)\n"); +// +// $call = $this->grpcManager->client->Publish($publishRequest); +// this->logger->debug("call: . json_encode($call)\n"); +// } catch (SdkError $e) { +// $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); +// return ResponseFuture::createResolved(new TopicPublishResponseError($e)); +// } catch (Exception $e) { +// $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); +// return ResponseFuture::createResolved(new TopicPublishResponseError(new UnknownError($e->getMessage()))); +// } +// +// return ResponseFuture::createPending( +// function () use ($call): TopicPublishResponse { +// try { +// $this->processCall($call); +// } catch (SdkError $e) { +// return new TopicPublishResponseError($e); +// } catch (Exception $e) { +// return new TopicPublishResponseError(new UnknownError($e->getMessage())); +// } +// +// return new TopicPublishResponseSuccess(); +// } +// ); +// } public function close(): void diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index f5c48619..79474872 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -59,6 +59,6 @@ public function setLogger(LoggerInterface $logger): void public function publish(string $cacheName, string $topicName, string $message): TopicPublishResponse { $this->logger->info("Publishing to topic: $topicName\n"); - return $this->topicClient->publish($cacheName, $topicName, $message)-> wait(); + return $this->topicClient->publish($cacheName, $topicName, $message); } } From 83a379f564ba7d1b62ec21db59b19038285c52a8 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:09:28 -0800 Subject: [PATCH 04/64] fix: add more logging --- examples/topic-example.php | 6 +- .../CacheOperationTypes.php | 41 ++++++++++ src/Topic/Internal/ScsTopicClient.php | 76 +++++++++---------- src/Topic/TopicClient.php | 6 ++ 4 files changed, 86 insertions(+), 43 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 92eae3bb..e0623b71 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -54,11 +54,11 @@ function printBanner(string $message, LoggerInterface $logger): void // Publish to topic $logger->info("Publishing to topic: $TOPIC_NAME\n"); -$response = $topicClient->publish($TOPIC_NAME, $CACHE_NAME, "MyMessage"); +$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "MyMessage"); if ($response->asSuccess()) { - $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); + $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); } elseif ($response->asError()) { - $logger->info("Error subscribing to topic: " . $response->asError()->message() . "\n"); + $logger->info("Error publishing to topic: " . $response->asError()->message() . "\n"); exit(1); } diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index f4922d8f..f455483b 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -2675,3 +2675,44 @@ class TopicPublishResponseError extends TopicPublishResponse { use ErrorBody; } + + +abstract class TopicSubscribeResponse extends ResponseBase +{ + /** + * @return TopicSubscribeResponseSubscription|null + */ + public function asSuccess(): ?TopicSubscribeResponseSubscription + { + if ($this->isSuccess()) { + return $this; + } + return null; + } + + /** + * @return TopicSubscribeResponseError|null Returns the error subtype if the request returned an error and null otherwise. + */ + public function asError(): ?TopicSubscribeResponseError + { + if ($this->isError()) { + return $this; + } + return null; + } +} + +/** + * Indicates that the request that generated it was successful. + */ +class TopicSubscribeResponseSubscription extends TopicSubscribeResponse +{ +} + +/** + * Contains information about an error returned from the request. + */ +class TopicSubscribeResponseError extends TopicSubscribeResponse +{ + use ErrorBody; +} diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 2166c108..4ab6f299 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -4,6 +4,7 @@ namespace Momento\Topic\Internal; use Cache_client\Pubsub\_PublishRequest; +use Cache_client\Pubsub\_SubscriptionRequest; use Cache_client\Pubsub\_TopicValue; use Exception; use Grpc\UnaryCall; @@ -12,6 +13,9 @@ use Momento\Cache\CacheOperationTypes\TopicPublishResponse; use Momento\Cache\CacheOperationTypes\TopicPublishResponseError; use Momento\Cache\CacheOperationTypes\TopicPublishResponseSuccess; +use Momento\Cache\CacheOperationTypes\TopicSubscribeResponse; +use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseError; +use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseSubscription; use Momento\Cache\Errors\SdkError; use Momento\Cache\Errors\UnknownError; use Momento\Config\IConfiguration; @@ -105,47 +109,39 @@ public function publish(string $cacheName, string $topicName, string $value): To } -// /** -// * @return TopicPublishResponse -// */ -// public function publish(string $cacheName, string $topicName, string $value): TopicPublishResponse -// { -// $topicValue = new _TopicValue(); -// $topicValue->setText($value); -// try { -// $this->logger->info("Publishing to topic: $topicName in cache $cacheName\n"); -// validateCacheName($cacheName); -// $publishRequest = new _PublishRequest(); -// $publishRequest->setCacheName($cacheName); -// $publishRequest->setTopic($topicName); -// $publishRequest->setValue($topicValue); -// $this->logger->debug("publishRequest: . json_encode($publishRequest)\n"); -// -// $call = $this->grpcManager->client->Publish($publishRequest); -// this->logger->debug("call: . json_encode($call)\n"); -// } catch (SdkError $e) { -// $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); -// return ResponseFuture::createResolved(new TopicPublishResponseError($e)); -// } catch (Exception $e) { -// $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); -// return ResponseFuture::createResolved(new TopicPublishResponseError(new UnknownError($e->getMessage()))); -// } -// -// return ResponseFuture::createPending( -// function () use ($call): TopicPublishResponse { -// try { -// $this->processCall($call); -// } catch (SdkError $e) { -// return new TopicPublishResponseError($e); -// } catch (Exception $e) { -// return new TopicPublishResponseError(new UnknownError($e->getMessage())); -// } -// -// return new TopicPublishResponseSuccess(); -// } -// ); -// } + /** + * Subscribe to a topic in a cache. + * + * @param string $cacheName The name of the cache. + * @param string $topicName The name of the topic to subscribe to. + * @param callable $callback The callback function to handle incoming messages. + */ + public function subscribe(string $cacheName, string $topicName, callable $callback): TopicSubscribeResponse + { + $this->logger->info("Subscribing to topic: $topicName in cache $cacheName\n"); + + try { + validateCacheName($cacheName); + $request = new _SubscriptionRequest(); + $request->setCacheName($cacheName); + $request->setTopic($topicName); + $call = $this->grpcManager->client->Subscribe($request); + + // Start a loop to handle incoming messages + foreach ($call->responses() as $response) { + // Invoke the callback with the received message + $callback($response); + } + } catch (SdkError $e) { + $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); + return new TopicSubscribeResponseError($e); + } catch (\Exception $e) { + $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); + return new TopicSubscribeResponseError(new UnknownError($e->getMessage())); + } + return new TopicSubscribeResponseSubscription(); + } public function close(): void { diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index 79474872..8e3627af 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -61,4 +61,10 @@ public function publish(string $cacheName, string $topicName, string $message): $this->logger->info("Publishing to topic: $topicName\n"); return $this->topicClient->publish($cacheName, $topicName, $message); } + + public function subscribe(string $cacheName, string $topicName, string $message): TopicPublishResponse + { + $this->logger->info("Subscribing to topic: $topicName\n"); + return $this->topicClient->subscribe($cacheName, $topicName, $message); + } } From 91c157113539d1284bdb58b531a70d7ed0918d48 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:15:53 -0800 Subject: [PATCH 05/64] fix: add more logging --- composer.json | 3 +- composer.lock | 614 ++++++++++++++++++-------- examples/topic-example.php | 16 +- src/Topic/Internal/ScsTopicClient.php | 1 - src/Topic/TopicClient.php | 8 +- 5 files changed, 436 insertions(+), 206 deletions(-) diff --git a/composer.json b/composer.json index 9787922a..3142327c 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,8 @@ "google/protobuf": "3.22.3", "grpc/grpc": "1.52.0", "psr/log": "^1.1 || ^2.0 || ^3.0", - "psr/simple-cache": "^1.0.1 || ^3.0" + "psr/simple-cache": "^1.0.1 || ^3.0", + "ext-json": "*" }, "require-dev": { "composer/composer": "^2.4.1", diff --git a/composer.lock b/composer.lock index ef778f03..2f92da89 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "firebase/php-jwt", - "version": "v6.8.1", + "version": "v6.10.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" + "reference": "a49db6f0a5033aef5143295342f1c95521b075ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", - "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff", + "reference": "a49db6f0a5033aef5143295342f1c95521b075ff", "shasum": "" }, "require": { @@ -63,7 +63,11 @@ "jwt", "php" ], - "time": "2023-07-14T18:33:00+00:00" + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.10.0" + }, + "time": "2023-12-01T16:26:39+00:00" }, { "name": "google/protobuf", @@ -155,30 +159,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -198,29 +202,32 @@ "psr", "psr-3" ], - "time": "2021-05-03T11:20:27+00:00" + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -235,7 +242,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -246,22 +253,25 @@ "psr-16", "simple-cache" ], - "time": "2017-10-23T01:57:42+00:00" + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" } ], "packages-dev": [ { "name": "composer/ca-bundle", - "version": "1.3.7", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" + "reference": "b66d11b7479109ab547f9405b97205640b17d385" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b66d11b7479109ab547f9405b97205640b17d385", + "reference": "b66d11b7479109ab547f9405b97205640b17d385", "shasum": "" }, "require": { @@ -273,7 +283,7 @@ "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -305,6 +315,11 @@ "ssl", "tls" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.4.0" + }, "funding": [ { "url": "https://packagist.com", @@ -319,7 +334,7 @@ "type": "tidelift" } ], - "time": "2023-08-30T09:31:38+00:00" + "time": "2023-12-18T12:05:55+00:00" }, { "name": "composer/class-map-generator", @@ -374,6 +389,10 @@ "keywords": [ "classmap" ], + "support": { + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.1.0" + }, "funding": [ { "url": "https://packagist.com", @@ -392,16 +411,16 @@ }, { "name": "composer/composer", - "version": "2.6.4", + "version": "2.6.6", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "d75d17c16a863438027d1d96401cddcd6aa5bb60" + "reference": "683557bd2466072777309d039534bb1332d0dda5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/d75d17c16a863438027d1d96401cddcd6aa5bb60", - "reference": "d75d17c16a863438027d1d96401cddcd6aa5bb60", + "url": "https://api.github.com/repos/composer/composer/zipball/683557bd2466072777309d039534bb1332d0dda5", + "reference": "683557bd2466072777309d039534bb1332d0dda5", "shasum": "" }, "require": { @@ -419,7 +438,7 @@ "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.2", "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.11 || ^6.0.11 || ^7", + "symfony/console": "^5.4.11 || ^6.0.11", "symfony/filesystem": "^5.4 || ^6.0 || ^7", "symfony/finder": "^5.4 || ^6.0 || ^7", "symfony/polyfill-php73": "^1.24", @@ -482,6 +501,12 @@ "dependency", "package" ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/composer/issues", + "security": "https://github.com/composer/composer/security/policy", + "source": "https://github.com/composer/composer/tree/2.6.6" + }, "funding": [ { "url": "https://packagist.com", @@ -496,7 +521,7 @@ "type": "tidelift" } ], - "time": "2023-09-29T08:54:47+00:00" + "time": "2023-12-08T17:32:26+00:00" }, { "name": "composer/metadata-minifier", @@ -547,6 +572,10 @@ "composer", "compression" ], + "support": { + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" + }, "funding": [ { "url": "https://packagist.com", @@ -565,16 +594,16 @@ }, { "name": "composer/pcre", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", "shasum": "" }, "require": { @@ -614,6 +643,10 @@ "regex", "regular expression" ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.1" + }, "funding": [ { "url": "https://packagist.com", @@ -628,7 +661,7 @@ "type": "tidelift" } ], - "time": "2022-11-17T09:50:14+00:00" + "time": "2023-10-11T07:11:09+00:00" }, { "name": "composer/semver", @@ -690,6 +723,11 @@ "validation", "versioning" ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, "funding": [ { "url": "https://packagist.com", @@ -708,16 +746,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.7", + "version": "1.5.8", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "c848241796da2abf65837d51dce1fae55a960149" + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/c848241796da2abf65837d51dce1fae55a960149", - "reference": "c848241796da2abf65837d51dce1fae55a960149", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", "shasum": "" }, "require": { @@ -765,6 +803,11 @@ "spdx", "validator" ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" + }, "funding": [ { "url": "https://packagist.com", @@ -779,7 +822,7 @@ "type": "tidelift" } ], - "time": "2022-05-23T07:37:50+00:00" + "time": "2023-11-20T07:44:33+00:00" }, { "name": "composer/xdebug-handler", @@ -826,6 +869,11 @@ "Xdebug", "performance" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, "funding": [ { "url": "https://packagist.com", @@ -844,30 +892,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -892,6 +940,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -906,7 +958,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "justinrainbow/json-schema", @@ -972,6 +1024,10 @@ "json", "schema" ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" + }, "time": "2023-09-26T02:20:38+00:00" }, { @@ -1021,6 +1077,10 @@ "object", "object graph" ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", @@ -1031,16 +1091,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v4.18.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", "shasum": "" }, "require": { @@ -1079,7 +1139,11 @@ "parser", "php" ], - "time": "2023-08-13T19:53:39+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + }, + "time": "2023-12-10T21:03:43+00:00" }, { "name": "phar-io/manifest", @@ -1135,6 +1199,10 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, "time": "2021-07-20T11:28:43+00:00" }, { @@ -1182,27 +1250,31 @@ } ], "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.29", + "version": "9.2.30", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca2bd87d2f9215904682a9cb9bb37dda98e76089", + "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1249,13 +1321,18 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.30" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2023-09-19T04:57:46+00:00" + "time": "2023-12-22T06:47:57+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1305,6 +1382,10 @@ "filesystem", "iterator" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1364,6 +1445,10 @@ "keywords": [ "process" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1419,6 +1504,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1474,6 +1563,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1484,16 +1577,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.13", + "version": "9.6.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", "shasum": "" }, "require": { @@ -1564,6 +1657,11 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" + }, "funding": [ { "url": "https://phpunit.de/sponsors.html", @@ -1578,26 +1676,31 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2023-12-01T16:55:19+00:00" }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -1622,28 +1725,32 @@ "container-interop", "psr" ], - "time": "2021-11-05T16:50:12+00:00" + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" }, { "name": "react/promise", - "version": "v3.0.0", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "c86753c76fd3be465d93b308f18d189f01a22be4" + "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/c86753c76fd3be465d93b308f18d189f01a22be4", - "reference": "c86753c76fd3be465d93b308f18d189f01a22be4", + "url": "https://api.github.com/repos/reactphp/promise/zipball/e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", + "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", "shasum": "" }, "require": { "php": ">=7.1.0" }, "require-dev": { - "phpstan/phpstan": "1.10.20 || 1.4.10", - "phpunit/phpunit": "^9.5 || ^7.5" + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", "autoload": { @@ -1685,13 +1792,17 @@ "promise", "promises" ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.1.0" + }, "funding": [ { "url": "https://opencollective.com/reactphp", "type": "open_collective" } ], - "time": "2023-07-11T16:12:49+00:00" + "time": "2023-11-16T16:21:57+00:00" }, { "name": "sebastian/cli-parser", @@ -1737,6 +1848,10 @@ ], "description": "Library for parsing CLI options", "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1789,6 +1904,10 @@ ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1840,6 +1959,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1910,6 +2033,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1920,20 +2047,20 @@ }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -1963,13 +2090,17 @@ ], "description": "Library for calculating the complexity of PHP code units", "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", @@ -2025,6 +2156,10 @@ "unidiff", "unified diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2084,6 +2219,10 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2157,6 +2296,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2217,6 +2360,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2227,20 +2374,20 @@ }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -2270,13 +2417,17 @@ ], "description": "Library for counting the lines of code in PHP source code", "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", @@ -2323,6 +2474,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2374,6 +2529,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2433,6 +2592,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2484,6 +2647,10 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2536,6 +2703,10 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2585,6 +2756,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -2595,16 +2770,16 @@ }, { "name": "seld/jsonlint", - "version": "1.10.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" + "reference": "76d449a358ece77d6f1d6331c68453e657172202" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/76d449a358ece77d6f1d6331c68453e657172202", + "reference": "76d449a358ece77d6f1d6331c68453e657172202", "shasum": "" }, "require": { @@ -2631,7 +2806,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "JSON Linter", @@ -2641,6 +2816,10 @@ "parser", "validator" ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.1" + }, "funding": [ { "url": "https://github.com/Seldaek", @@ -2651,7 +2830,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T13:16:46+00:00" + "time": "2023-12-18T13:03:25+00:00" }, { "name": "seld/phar-utils", @@ -2695,6 +2874,10 @@ "keywords": [ "phar" ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" + }, "time": "2022-08-31T10:31:18+00:00" }, { @@ -2752,56 +2935,55 @@ "sigterm", "unix" ], + "support": { + "issues": "https://github.com/Seldaek/signal-handler/issues", + "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" + }, "time": "2023-09-03T09:24:00+00:00" }, { "name": "symfony/console", - "version": "v5.4.28", + "version": "v6.4.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827" + "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827", + "url": "https://api.github.com/repos/symfony/console/zipball/0254811a143e6bc6c8deea08b589a7e68a37f625", + "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -2834,6 +3016,9 @@ "console", "terminal" ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.4.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2848,29 +3033,29 @@ "type": "tidelift" } ], - "time": "2023-08-07T06:12:30+00:00" + "time": "2023-12-10T16:15:48+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -2898,6 +3083,9 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2912,27 +3100,26 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.25", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" + "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", - "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/952a8cb588c3bc6ce76f6023000fb932f16a6e59", + "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "~1.8" }, "type": "library", "autoload": { @@ -2959,6 +3146,9 @@ ], "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.4.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2973,26 +3163,27 @@ "type": "tidelift" } ], - "time": "2023-05-31T13:04:02+00:00" + "time": "2023-07-26T17:27:13+00:00" }, { "name": "symfony/finder", - "version": "v5.4.27", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" + "reference": "11d736e97f116ac375a81f96e662911a34cd50ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", - "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "url": "https://api.github.com/repos/symfony/finder/zipball/11d736e97f116ac375a81f96e662911a34cd50ce", + "reference": "11d736e97f116ac375a81f96e662911a34cd50ce", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0|^7.0" }, "type": "library", "autoload": { @@ -3019,6 +3210,9 @@ ], "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v6.4.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3033,7 +3227,7 @@ "type": "tidelift" } ], - "time": "2023-07-31T08:02:31+00:00" + "time": "2023-10-31T17:30:12+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3098,6 +3292,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3176,6 +3373,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3257,6 +3457,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3337,6 +3540,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3413,6 +3619,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3493,6 +3702,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3569,6 +3781,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3587,21 +3802,20 @@ }, { "name": "symfony/process", - "version": "v5.4.28", + "version": "v6.4.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" + "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", - "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", + "url": "https://api.github.com/repos/symfony/process/zipball/c4b1ef0bc80533d87a2e969806172f1c2a980241", + "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -3628,6 +3842,9 @@ ], "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v6.4.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3642,37 +3859,33 @@ "type": "tidelift" } ], - "time": "2023-08-07T10:36:04+00:00" + "time": "2023-12-22T16:42:54+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -3682,7 +3895,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3708,6 +3924,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3722,38 +3941,38 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2023-12-26T14:02:43+00:00" }, { "name": "symfony/string", - "version": "v5.4.26", + "version": "v6.4.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1181fe9270e373537475e826873b5867b863883c" + "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", - "reference": "1181fe9270e373537475e826873b5867b863883c", + "url": "https://api.github.com/repos/symfony/string/zipball/7cb80bc10bfcdf6b5492741c0b9357dac66940bc", + "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3791,6 +4010,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.4.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3805,20 +4027,20 @@ "type": "tidelift" } ], - "time": "2023-06-28T12:46:07+00:00" + "time": "2023-12-10T16:15:48+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -3845,13 +4067,17 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + }, "funding": [ { "url": "https://github.com/theseer", "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" } ], "aliases": [], @@ -3864,5 +4090,5 @@ "ext-grpc": "*" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.6.0" } diff --git a/examples/topic-example.php b/examples/topic-example.php index e0623b71..1e6eb77d 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -43,14 +43,14 @@ function printBanner(string $message, LoggerInterface $logger): void } // Subscribe to topic -//$logger->info("Subscribing to topic: $TOPIC_NAME\n"); -//$response = $topicClient->subscribe($TOPIC_NAME, $CACHE_NAME); -//if ($response->asSubscription()) { -// $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); -//} elseif ($response->asError()) { -// $logger->info("Error subscribing to topic: " . $response->asError()->message() . "\n"); -// exit(1); -//} +$logger->info("Subscribing to topic: $TOPIC_NAME\n"); +$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME); +if ($response->asSuccess()) { + $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); +} elseif ($response->asError()) { + $logger->info("Error subscribing to topic: " . $response->asError()->message() . "\n"); + exit(1); +} // Publish to topic $logger->info("Publishing to topic: $TOPIC_NAME\n"); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 4ab6f299..bfd4cd99 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -77,7 +77,6 @@ private function returnCollectionTtl(?CollectionTtl $ttl): CollectionTtl private function processCall(UnaryCall $call) { [$response, $status] = $call->wait(); - $this->logger->debug("response: . json_encode($response)\n"); if ($status->code !== 0) { $this->logger->debug("Topic client error: {$status->details}"); throw _ErrorConverter::convert($status->code, $status->details, $call->getMetadata()); diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index 8e3627af..801837b6 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -6,6 +6,7 @@ use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; use Momento\Cache\CacheOperationTypes\TopicPublishResponse; +use Momento\Cache\CacheOperationTypes\TopicSubscribeResponse; use Momento\Cache\Internal\ScsControlClient; use Momento\Cache\Internal\ScsDataClient; use Momento\Config\IConfiguration; @@ -62,9 +63,12 @@ public function publish(string $cacheName, string $topicName, string $message): return $this->topicClient->publish($cacheName, $topicName, $message); } - public function subscribe(string $cacheName, string $topicName, string $message): TopicPublishResponse + public function subscribe(string $cacheName, string $topicName): TopicSubscribeResponse { $this->logger->info("Subscribing to topic: $topicName\n"); - return $this->topicClient->subscribe($cacheName, $topicName, $message); + $callback = function ($message) { + echo "Received message: " . json_encode($message) . "\n"; + }; + return $this->topicClient->subscribe($cacheName, $topicName, $callback); } } From c72b0269895d5e87f13ca0ac9e45844ad48974ed Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:17:43 -0800 Subject: [PATCH 06/64] fix: add more logging --- composer.lock | 5 +++-- src/Topic/TopicClient.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index 2f92da89..f3e9bb86 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "315b173030672bf79996957c7ca1f4a4", + "content-hash": "a302f7a65e97f346b0f3c88db6ed9138", "packages": [ { "name": "firebase/php-jwt", @@ -4087,7 +4087,8 @@ "prefer-lowest": false, "platform": { "php": ">=7.4", - "ext-grpc": "*" + "ext-grpc": "*", + "ext-json": "*" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index 801837b6..d80b00e7 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -67,7 +67,8 @@ public function subscribe(string $cacheName, string $topicName): TopicSubscribeR { $this->logger->info("Subscribing to topic: $topicName\n"); $callback = function ($message) { - echo "Received message: " . json_encode($message) . "\n"; + $this->logger->info("Received message: " . json_encode($message) . "\n"); +// echo "Received message: " . json_encode($message) . "\n"; }; return $this->topicClient->subscribe($cacheName, $topicName, $callback); } From 6a47750f86c0bced4f6df8364b6359974aa2bae9 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:20:39 -0800 Subject: [PATCH 07/64] fix: add more logging --- src/Topic/Internal/ScsTopicClient.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index bfd4cd99..ad8cee0e 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -127,9 +127,8 @@ public function subscribe(string $cacheName, string $topicName, callable $callba $call = $this->grpcManager->client->Subscribe($request); - // Start a loop to handle incoming messages foreach ($call->responses() as $response) { - // Invoke the callback with the received message + $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); $callback($response); } } catch (SdkError $e) { From 17e221cfddce668d143d2af68b51cab6f2376d8c Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:24:35 -0800 Subject: [PATCH 08/64] fix: add callback function --- examples/topic-example.php | 5 ++++- src/Topic/TopicClient.php | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 1e6eb77d..e40b82dd 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -44,7 +44,10 @@ function printBanner(string $message, LoggerInterface $logger): void // Subscribe to topic $logger->info("Subscribing to topic: $TOPIC_NAME\n"); -$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME); +$callback = function ($message) use ($logger) { + $logger->info("Received message: " . json_encode($message)); +}; +$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $callback); if ($response->asSuccess()) { $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); } elseif ($response->asError()) { diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index d80b00e7..42998154 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -63,13 +63,9 @@ public function publish(string $cacheName, string $topicName, string $message): return $this->topicClient->publish($cacheName, $topicName, $message); } - public function subscribe(string $cacheName, string $topicName): TopicSubscribeResponse + public function subscribe(string $cacheName, string $topicName, callable $callback): TopicSubscribeResponse { $this->logger->info("Subscribing to topic: $topicName\n"); - $callback = function ($message) { - $this->logger->info("Received message: " . json_encode($message) . "\n"); -// echo "Received message: " . json_encode($message) . "\n"; - }; return $this->topicClient->subscribe($cacheName, $topicName, $callback); } } From ad52a0f71bc656a2cd5268c4e6b493e69e65eeff Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:26:56 -0800 Subject: [PATCH 09/64] fix: add callback function --- examples/topic-example.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/topic-example.php b/examples/topic-example.php index e40b82dd..921a04cb 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -46,6 +46,7 @@ function printBanner(string $message, LoggerInterface $logger): void $logger->info("Subscribing to topic: $TOPIC_NAME\n"); $callback = function ($message) use ($logger) { $logger->info("Received message: " . json_encode($message)); + file_put_contents('message_received.flag', '1'); }; $response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $callback); if ($response->asSuccess()) { @@ -65,6 +66,11 @@ function printBanner(string $message, LoggerInterface $logger): void exit(1); } +// Wait for a message to be received and logged +while (!file_exists('message_received.flag')) { + sleep(1); // Sleep for 1 second before checking again +} + // Delete test cache //$logger->info("Deleting cache $CACHE_NAME\n"); From a709eab004912eac5689e1ece444edcf5dd673f0 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:29:16 -0800 Subject: [PATCH 10/64] fix: add callback function --- examples/topic-example.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 921a04cb..9667b34c 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -67,7 +67,8 @@ function printBanner(string $message, LoggerInterface $logger): void } // Wait for a message to be received and logged -while (!file_exists('message_received.flag')) { +$timeout = time() + 60; +while (!file_exists('message_received.flag') && time() < $timeout) { sleep(1); // Sleep for 1 second before checking again } From 6afb49505d5cb6eed4e7a3ca64da83d892ee8e21 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 14:35:44 -0800 Subject: [PATCH 11/64] fix: subscribe method update --- examples/topic-example.php | 4 ++-- src/Topic/Internal/ScsTopicClient.php | 16 ++++++++++++---- src/Topic/TopicClient.php | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 9667b34c..0cbf67d8 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -44,11 +44,11 @@ function printBanner(string $message, LoggerInterface $logger): void // Subscribe to topic $logger->info("Subscribing to topic: $TOPIC_NAME\n"); -$callback = function ($message) use ($logger) { +$onMessage = function ($message) use ($logger) { $logger->info("Received message: " . json_encode($message)); file_put_contents('message_received.flag', '1'); }; -$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $callback); +$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); if ($response->asSuccess()) { $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); } elseif ($response->asError()) { diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index ad8cee0e..d755a062 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -113,9 +113,10 @@ public function publish(string $cacheName, string $topicName, string $value): To * * @param string $cacheName The name of the cache. * @param string $topicName The name of the topic to subscribe to. - * @param callable $callback The callback function to handle incoming messages. + * @param callable $onMessage Callback for handling incoming messages. + * @return TopicSubscribeResponse */ - public function subscribe(string $cacheName, string $topicName, callable $callback): TopicSubscribeResponse + public function subscribe(string $cacheName, string $topicName, callable $onMessage): TopicSubscribeResponse { $this->logger->info("Subscribing to topic: $topicName in cache $cacheName\n"); @@ -128,9 +129,15 @@ public function subscribe(string $cacheName, string $topicName, callable $callba $call = $this->grpcManager->client->Subscribe($request); foreach ($call->responses() as $response) { - $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $callback($response); + try { + $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); + $onMessage($response); + } catch (\Exception $e) { + $this->logger->error("Error processing message: " . $e->getMessage()); + } } + + } catch (SdkError $e) { $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); return new TopicSubscribeResponseError($e); @@ -138,6 +145,7 @@ public function subscribe(string $cacheName, string $topicName, callable $callba $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); return new TopicSubscribeResponseError(new UnknownError($e->getMessage())); } + return new TopicSubscribeResponseSubscription(); } diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index 42998154..59cfc703 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -63,9 +63,9 @@ public function publish(string $cacheName, string $topicName, string $message): return $this->topicClient->publish($cacheName, $topicName, $message); } - public function subscribe(string $cacheName, string $topicName, callable $callback): TopicSubscribeResponse + public function subscribe(string $cacheName, string $topicName, callable $onMessage): TopicSubscribeResponse { $this->logger->info("Subscribing to topic: $topicName\n"); - return $this->topicClient->subscribe($cacheName, $topicName, $callback); + return $this->topicClient->subscribe($cacheName, $topicName, $onMessage); } } From 371faf3f240135990eebb5f9bc44a5de5aa07d04 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:03:48 -0800 Subject: [PATCH 12/64] fix: add streaming call --- src/Topic/Internal/ScsTopicClient.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index d755a062..03f0e681 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -7,6 +7,7 @@ use Cache_client\Pubsub\_SubscriptionRequest; use Cache_client\Pubsub\_TopicValue; use Exception; +use Grpc\ServerStreamingCall; use Grpc\UnaryCall; use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; @@ -84,6 +85,28 @@ private function processCall(UnaryCall $call) return $response; } + private function processStreamingCall(ServerStreamingCall $call): void + { + // Retrieve metadata and status using the metadata() method + list($response, $status) = $call->responses(); + + if ($status->code !== 0) { + $this->logger->error("Error during streaming call setup: {$status->details}"); + throw _ErrorConverter::convert($status->code, $status->details, $call->getMetadata()); + } + + // Optionally, you can log any metadata received during the initial setup. + $metadata = $call->getMetadata(); + $this->logger->info("Initial metadata received: " . json_encode($metadata)); + + // Optionally, log the start of the streaming process. + $this->logger->info("Streaming call initiated successfully."); + } + + + + + public function publish(string $cacheName, string $topicName, string $value): TopicPublishResponse { $this->logger->info("Publishing to topic: $topicName in cache $cacheName\n"); @@ -127,6 +150,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setTopic($topicName); $call = $this->grpcManager->client->Subscribe($request); + $this->processStreamingCall($call); foreach ($call->responses() as $response) { try { From 2512babe4a6514493c374d03fea12096552954ff Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:05:52 -0800 Subject: [PATCH 13/64] fix: add streaming call --- src/Topic/Internal/ScsTopicClient.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 03f0e681..f03fb314 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -87,26 +87,27 @@ private function processCall(UnaryCall $call) private function processStreamingCall(ServerStreamingCall $call): void { - // Retrieve metadata and status using the metadata() method - list($response, $status) = $call->responses(); + foreach ($call->responses() as $response) { + // Process each response individually + $this->logger->info("Received message: " . json_encode($response)); + // Optionally, you can log any metadata received during the initial setup. + $metadata = $call->getMetadata(); + $this->logger->info("Initial metadata received: " . json_encode($metadata)); + + // Optionally, log the start of the streaming process. + $this->logger->info("Streaming call initiated successfully."); + } + + // Handle the end of the streaming process + $status = $call->getStatus(); if ($status->code !== 0) { - $this->logger->error("Error during streaming call setup: {$status->details}"); + $this->logger->error("Error during streaming: {$status->details}"); throw _ErrorConverter::convert($status->code, $status->details, $call->getMetadata()); } - - // Optionally, you can log any metadata received during the initial setup. - $metadata = $call->getMetadata(); - $this->logger->info("Initial metadata received: " . json_encode($metadata)); - - // Optionally, log the start of the streaming process. - $this->logger->info("Streaming call initiated successfully."); } - - - public function publish(string $cacheName, string $topicName, string $value): TopicPublishResponse { $this->logger->info("Publishing to topic: $topicName in cache $cacheName\n"); From c810d8f27533c2074da3ff7ca5ca89fe4521dbe2 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:11:40 -0800 Subject: [PATCH 14/64] fix: add streaming call --- src/Topic/Internal/ScsTopicClient.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index f03fb314..28b2084d 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -39,9 +39,11 @@ class ScsTopicClient implements LoggerAwareInterface private TopicGrpcManager $grpcManager; private LoggerInterface $logger; private int $timeout; + private $authToken; public function __construct(IConfiguration $configuration, ICredentialProvider $authProvider) { + $authToken = $authProvider->getAuthToken(); $operationTimeoutMs = $configuration ->getTransportStrategy() ->getGrpcConfig() @@ -146,11 +148,15 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess try { validateCacheName($cacheName); + + $authToken = $this->authToken; + + $request = new _SubscriptionRequest(); $request->setCacheName($cacheName); $request->setTopic($topicName); - $call = $this->grpcManager->client->Subscribe($request); + $call = $this->grpcManager->client->Subscribe($request, ['authorization' => ['Bearer ' . $authToken]]); $this->processStreamingCall($call); foreach ($call->responses() as $response) { From 78d0ab5382504c91c392dc6e55da7c365edbc6f1 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:13:15 -0800 Subject: [PATCH 15/64] fix: add streaming call --- src/Topic/Internal/ScsTopicClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 28b2084d..5893bbe7 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -150,7 +150,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess validateCacheName($cacheName); $authToken = $this->authToken; - + $this->logger->info("Using auth token: $authToken\n"); $request = new _SubscriptionRequest(); $request->setCacheName($cacheName); From fec52f3c8f505ba1360ceed23da3facb0f802d25 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:14:29 -0800 Subject: [PATCH 16/64] fix: add streaming call --- src/Topic/Internal/ScsTopicClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 5893bbe7..1cc107d4 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -43,7 +43,7 @@ class ScsTopicClient implements LoggerAwareInterface public function __construct(IConfiguration $configuration, ICredentialProvider $authProvider) { - $authToken = $authProvider->getAuthToken(); + $this->authToken = $authProvider->getAuthToken(); $operationTimeoutMs = $configuration ->getTransportStrategy() ->getGrpcConfig() From b3a547bfed3a5fbf52f1d79717dc4a3459a15ade Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:29:36 -0800 Subject: [PATCH 17/64] fix: authorization header format --- src/Topic/Internal/ScsTopicClient.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 1cc107d4..cf35e15a 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -156,7 +156,12 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setCacheName($cacheName); $request->setTopic($topicName); - $call = $this->grpcManager->client->Subscribe($request, ['authorization' => ['Bearer ' . $authToken]]); + $call = $this->grpcManager->client->Subscribe($request, [], [ + 'timeout' => $this->timeout, + 'headers' => [ + 'authorization' => $authToken, + ], + ]); $this->processStreamingCall($call); foreach ($call->responses() as $response) { From ad1005ea27c05276096940fe279d047ee90a48a5 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:31:27 -0800 Subject: [PATCH 18/64] fix: authorization header format --- src/Topic/Internal/ScsTopicClient.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index cf35e15a..799aebc9 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -156,12 +156,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setCacheName($cacheName); $request->setTopic($topicName); - $call = $this->grpcManager->client->Subscribe($request, [], [ - 'timeout' => $this->timeout, - 'headers' => [ - 'authorization' => $authToken, - ], - ]); + $call = $this->grpcManager->client->Subscribe($request, ['authorization' => $authToken]); $this->processStreamingCall($call); foreach ($call->responses() as $response) { From 6cf864defc1304f451292fd30b7a443f3c8f0c4b Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:37:35 -0800 Subject: [PATCH 19/64] fix: authorization header format --- src/Topic/Internal/ScsTopicClient.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 799aebc9..0e60d3c1 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -89,19 +89,14 @@ private function processCall(UnaryCall $call) private function processStreamingCall(ServerStreamingCall $call): void { + $this->logger->info("Processing streaming call\n"); foreach ($call->responses() as $response) { - // Process each response individually $this->logger->info("Received message: " . json_encode($response)); - - // Optionally, you can log any metadata received during the initial setup. - $metadata = $call->getMetadata(); - $this->logger->info("Initial metadata received: " . json_encode($metadata)); - - // Optionally, log the start of the streaming process. +// $metadata = $call->getMetadata(); +// $this->logger->info("Initial metadata received: " . json_encode($metadata)); $this->logger->info("Streaming call initiated successfully."); } - // Handle the end of the streaming process $status = $call->getStatus(); if ($status->code !== 0) { $this->logger->error("Error during streaming: {$status->details}"); @@ -157,7 +152,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setTopic($topicName); $call = $this->grpcManager->client->Subscribe($request, ['authorization' => $authToken]); - $this->processStreamingCall($call); +// $this->processStreamingCall($call); foreach ($call->responses() as $response) { try { From 6f336398560ad5872d6e1afaacabfea330af1ef6 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:39:00 -0800 Subject: [PATCH 20/64] fix: authorization header format --- src/Topic/Internal/ScsTopicClient.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 0e60d3c1..db07f3c9 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -153,6 +153,9 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $call = $this->grpcManager->client->Subscribe($request, ['authorization' => $authToken]); // $this->processStreamingCall($call); + $this->logger->info("Streaming call initiated successfully."); + $this->logger->info("Waiting for messages...\n"); + $this->logger->info($call->getStatus()->details); foreach ($call->responses() as $response) { try { From afe304c9ba60d4274a61de5c5476146238c24018 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:42:48 -0800 Subject: [PATCH 21/64] fix: example --- examples/topic-example.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 0cbf67d8..416149c3 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -46,7 +46,7 @@ function printBanner(string $message, LoggerInterface $logger): void $logger->info("Subscribing to topic: $TOPIC_NAME\n"); $onMessage = function ($message) use ($logger) { $logger->info("Received message: " . json_encode($message)); - file_put_contents('message_received.flag', '1'); +// file_put_contents('message_received.flag', '1'); }; $response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); if ($response->asSuccess()) { @@ -56,21 +56,23 @@ function printBanner(string $message, LoggerInterface $logger): void exit(1); } +sleep(1000); + // Publish to topic -$logger->info("Publishing to topic: $TOPIC_NAME\n"); -$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "MyMessage"); -if ($response->asSuccess()) { - $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); -} elseif ($response->asError()) { - $logger->info("Error publishing to topic: " . $response->asError()->message() . "\n"); - exit(1); -} +//$logger->info("Publishing to topic: $TOPIC_NAME\n"); +//$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "MyMessage"); +//if ($response->asSuccess()) { +// $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); +//} elseif ($response->asError()) { +// $logger->info("Error publishing to topic: " . $response->asError()->message() . "\n"); +// exit(1); +//} // Wait for a message to be received and logged -$timeout = time() + 60; -while (!file_exists('message_received.flag') && time() < $timeout) { - sleep(1); // Sleep for 1 second before checking again -} +//$timeout = time() + 60; +//while (!file_exists('message_received.flag') && time() < $timeout) { +// sleep(1); // Sleep for 1 second before checking again +//} // Delete test cache From 2ef9f02c26d15d015e065df0e1e2cfdba83b0c6f Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 15:47:20 -0800 Subject: [PATCH 22/64] fix: example --- examples/topic-example.php | 2 +- src/Topic/Internal/ScsTopicClient.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 416149c3..816fef8a 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -56,7 +56,7 @@ function printBanner(string $message, LoggerInterface $logger): void exit(1); } -sleep(1000); +sleep(1000); // Publish to topic //$logger->info("Publishing to topic: $TOPIC_NAME\n"); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index db07f3c9..5537faee 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -158,6 +158,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $this->logger->info($call->getStatus()->details); foreach ($call->responses() as $response) { + $this->logger->info("inside for loop"); try { $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); $onMessage($response); From 3b5ef161ec67d6e942c27ed7ee126a416cc89dab Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:13:18 -0800 Subject: [PATCH 23/64] fix: example --- examples/topic-example.php | 2 -- src/Topic/Internal/ScsTopicClient.php | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 816fef8a..2970ca0c 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -56,8 +56,6 @@ function printBanner(string $message, LoggerInterface $logger): void exit(1); } -sleep(1000); - // Publish to topic //$logger->info("Publishing to topic: $TOPIC_NAME\n"); //$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "MyMessage"); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 5537faee..040af9cf 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -151,7 +151,13 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setCacheName($cacheName); $request->setTopic($topicName); - $call = $this->grpcManager->client->Subscribe($request, ['authorization' => $authToken]); + try { + $call = $this->grpcManager->client->Subscribe($request, ['authorization' => $authToken]); + } catch (Exception $e) { + $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); + throw $e; + } + // $this->processStreamingCall($call); $this->logger->info("Streaming call initiated successfully."); $this->logger->info("Waiting for messages...\n"); From 2963f8d783766ed325f0ee701c3bc08f418a88cf Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:15:07 -0800 Subject: [PATCH 24/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 040af9cf..7a71f5dd 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -152,7 +152,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setTopic($topicName); try { - $call = $this->grpcManager->client->Subscribe($request, ['authorization' => $authToken]); + $call = $this->grpcManager->client->Subscribe($request); } catch (Exception $e) { $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); throw $e; From 30d6e78c4e20caa103be3478c79a90e62a7b7369 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:16:30 -0800 Subject: [PATCH 25/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 7a71f5dd..ba15b13d 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -152,7 +152,12 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setTopic($topicName); try { - $call = $this->grpcManager->client->Subscribe($request); + $call = $this->grpcManager->client->Subscribe($request, [], [ + 'timeout' => $this->timeout, + 'headers' => [ + 'authorization' => $authToken, + ], + ]); } catch (Exception $e) { $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); throw $e; From 6a347b42bd37dd79802a069490648bf0faecb229 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:18:05 -0800 Subject: [PATCH 26/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index ba15b13d..cae90cb2 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -152,12 +152,13 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $request->setTopic($topicName); try { - $call = $this->grpcManager->client->Subscribe($request, [], [ + $callOptions = [ 'timeout' => $this->timeout, 'headers' => [ - 'authorization' => $authToken, + 'authorization' => [$authToken], ], - ]); + ]; + $call = $this->grpcManager->client->Subscribe($request, $callOptions); } catch (Exception $e) { $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); throw $e; From 0f650a04d405625fd8b6522ff444783defaaf655 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:19:29 -0800 Subject: [PATCH 27/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index cae90cb2..53c81321 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -158,7 +158,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess 'authorization' => [$authToken], ], ]; - $call = $this->grpcManager->client->Subscribe($request, $callOptions); + $call = $this->grpcManager->client->Subscribe($request, [], $callOptions); } catch (Exception $e) { $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); throw $e; From ff77a7c06c6812b6e4701bdadc6029a43e2e8fcc Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:22:09 -0800 Subject: [PATCH 28/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 53c81321..f0051c8d 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -145,20 +145,16 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess validateCacheName($cacheName); $authToken = $this->authToken; - $this->logger->info("Using auth token: $authToken\n"); + $metadata = [ + 'authorization' => [$authToken], + ]; $request = new _SubscriptionRequest(); $request->setCacheName($cacheName); $request->setTopic($topicName); try { - $callOptions = [ - 'timeout' => $this->timeout, - 'headers' => [ - 'authorization' => [$authToken], - ], - ]; - $call = $this->grpcManager->client->Subscribe($request, [], $callOptions); + $call = $this->grpcManager->client->Subscribe($request, $metadata); } catch (Exception $e) { $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); throw $e; From 415a0f8b0ac8cf00fee5927ea9898e24ba15bff0 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:29:07 -0800 Subject: [PATCH 29/64] fix: example run --- examples/topic-example.php | 10 +++++----- src/Topic/Internal/ScsTopicClient.php | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 2970ca0c..7931bc84 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -46,7 +46,7 @@ function printBanner(string $message, LoggerInterface $logger): void $logger->info("Subscribing to topic: $TOPIC_NAME\n"); $onMessage = function ($message) use ($logger) { $logger->info("Received message: " . json_encode($message)); -// file_put_contents('message_received.flag', '1'); + file_put_contents('message_received.flag', '1'); }; $response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); if ($response->asSuccess()) { @@ -67,10 +67,10 @@ function printBanner(string $message, LoggerInterface $logger): void //} // Wait for a message to be received and logged -//$timeout = time() + 60; -//while (!file_exists('message_received.flag') && time() < $timeout) { -// sleep(1); // Sleep for 1 second before checking again -//} +$timeout = time() + 60; +while (!file_exists('message_received.flag') && time() < $timeout) { + sleep(1); // Sleep for 1 second before checking again +} // Delete test cache diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index f0051c8d..92bf1cba 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -165,14 +165,21 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess $this->logger->info("Waiting for messages...\n"); $this->logger->info($call->getStatus()->details); - foreach ($call->responses() as $response) { - $this->logger->info("inside for loop"); - try { - $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $onMessage($response); - } catch (\Exception $e) { - $this->logger->error("Error processing message: " . $e->getMessage()); + $this->logger->info("Before foreach"); + try{ + foreach ($call->responses() as $response) { + $this->logger->info("inside for loop"); + $this->logger->info("Received message content: " . json_encode($response)); + try { + $this->logger->info("Before calling onMessage"); + $onMessage($response); + $this->logger->info("After calling onMessage"); + } catch (\Exception $e) { + $this->logger->error("Error processing message: " . $e->getMessage()); + } } + } catch (\Exception $e){ + $this->logger->error("Exception in response stream: " . $e->getMessage()); } From 8abec292608b0774d524a67cd97ce6ed73977872 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:30:00 -0800 Subject: [PATCH 30/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 92bf1cba..2eb3da39 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -163,7 +163,6 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess // $this->processStreamingCall($call); $this->logger->info("Streaming call initiated successfully."); $this->logger->info("Waiting for messages...\n"); - $this->logger->info($call->getStatus()->details); $this->logger->info("Before foreach"); try{ From 6da2081670b4cfe5c82bfc3861b41cf5a416662a Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:39:40 -0800 Subject: [PATCH 31/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 137 ++++++++++++++++++-------- 1 file changed, 98 insertions(+), 39 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 2eb3da39..0455a952 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -9,6 +9,7 @@ use Exception; use Grpc\ServerStreamingCall; use Grpc\UnaryCall; +use http\Env\Response; use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; use Momento\Cache\CacheOperationTypes\TopicPublishResponse; @@ -135,63 +136,121 @@ public function publish(string $cacheName, string $topicName, string $value): To * @param string $cacheName The name of the cache. * @param string $topicName The name of the topic to subscribe to. * @param callable $onMessage Callback for handling incoming messages. - * @return TopicSubscribeResponse + * @return ResponseFuture */ - public function subscribe(string $cacheName, string $topicName, callable $onMessage): TopicSubscribeResponse + public function subscribe(string $cacheName, string $topicName, callable $onMessage): ResponseFuture { - $this->logger->info("Subscribing to topic: $topicName in cache $cacheName\n"); - try { validateCacheName($cacheName); $authToken = $this->authToken; - $metadata = [ - 'authorization' => [$authToken], - ]; + $this->logger->info("Using auth token: $authToken\n"); $request = new _SubscriptionRequest(); $request->setCacheName($cacheName); $request->setTopic($topicName); - try { - $call = $this->grpcManager->client->Subscribe($request, $metadata); - } catch (Exception $e) { - $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); - throw $e; - } + $call = $this->grpcManager->client->Subscribe($request, ['authorization' => [$authToken]]); + } catch (SdkError $e) { + return ResponseFuture::createResolved(new TopicSubscribeResponseError($e)); + } catch (Exception $e) { + return ResponseFuture::createResolved(new TopicSubscribeResponseError(new UnknownError($e->getMessage(), 0, $e))); + } -// $this->processStreamingCall($call); - $this->logger->info("Streaming call initiated successfully."); - $this->logger->info("Waiting for messages...\n"); - - $this->logger->info("Before foreach"); - try{ - foreach ($call->responses() as $response) { - $this->logger->info("inside for loop"); - $this->logger->info("Received message content: " . json_encode($response)); - try { - $this->logger->info("Before calling onMessage"); - $onMessage($response); - $this->logger->info("After calling onMessage"); - } catch (\Exception $e) { - $this->logger->error("Error processing message: " . $e->getMessage()); + return ResponseFuture::createPending( + function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeResponse { + try { + $this->logger->info("Streaming call initiated successfully for topic $topicName in cache $cacheName.\n"); + $this->logger->info("Waiting for messages...\n"); + + foreach ($call->responses() as $response) { + try { + $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); + $onMessage($response); + } catch (\Exception $e) { + $this->logger->error("Error processing message: " . $e->getMessage()); + } } + + return new TopicSubscribeResponseSubscription(); + } catch (SdkError $e) { + return new TopicSubscribeResponseError($e); + } catch (Exception $e) { + return new TopicSubscribeResponseError(new UnknownError($e->getMessage(), 0, $e)); } - } catch (\Exception $e){ - $this->logger->error("Exception in response stream: " . $e->getMessage()); } + ); + } - } catch (SdkError $e) { - $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); - return new TopicSubscribeResponseError($e); - } catch (\Exception $e) { - $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); - return new TopicSubscribeResponseError(new UnknownError($e->getMessage())); - } - return new TopicSubscribeResponseSubscription(); - } + + + + +// /** +// * Subscribe to a topic in a cache. +// * +// * @param string $cacheName The name of the cache. +// * @param string $topicName The name of the topic to subscribe to. +// * @param callable $onMessage Callback for handling incoming messages. +// * @return TopicSubscribeResponse +// */ +// public function subscribe(string $cacheName, string $topicName, callable $onMessage): TopicSubscribeResponse +// { +// $this->logger->info("Subscribing to topic: $topicName in cache $cacheName\n"); +// +// try { +// validateCacheName($cacheName); +// +// $authToken = $this->authToken; +// $metadata = [ +// 'authorization' => [$authToken], +// ]; +// +// $request = new _SubscriptionRequest(); +// $request->setCacheName($cacheName); +// $request->setTopic($topicName); +// +// try { +// $call = $this->grpcManager->client->Subscribe($request, $metadata); +// } catch (Exception $e) { +// $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); +// throw $e; +// } +// +//// $this->processStreamingCall($call); +// $this->logger->info("Streaming call initiated successfully."); +// $this->logger->info("Waiting for messages...\n"); +// +// $this->logger->info("Before foreach"); +// try{ +// foreach ($call->responses() as $response) { +// $this->logger->info("inside for loop"); +// $this->logger->info("Received message content: " . json_encode($response)); +// try { +// $this->logger->info("Before calling onMessage"); +// $onMessage($response); +// $this->logger->info("After calling onMessage"); +// } catch (\Exception $e) { +// $this->logger->error("Error processing message: " . $e->getMessage()); +// } +// } +// } catch (\Exception $e){ +// $this->logger->error("Exception in response stream: " . $e->getMessage()); +// } +// +// +// } catch (SdkError $e) { +// $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); +// return new TopicSubscribeResponseError($e); +// } catch (\Exception $e) { +// $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); +// return new TopicSubscribeResponseError(new UnknownError($e->getMessage())); +// } +// +// return new TopicSubscribeResponseSubscription(); +// } public function close(): void { From 146e1b264f15ed60679d5d0271dc1e4dc4e5dec2 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:42:55 -0800 Subject: [PATCH 32/64] fix: example run --- examples/topic-example.php | 2 +- src/Topic/Internal/ScsTopicClient.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 7931bc84..5525cdb5 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -46,7 +46,7 @@ function printBanner(string $message, LoggerInterface $logger): void $logger->info("Subscribing to topic: $TOPIC_NAME\n"); $onMessage = function ($message) use ($logger) { $logger->info("Received message: " . json_encode($message)); - file_put_contents('message_received.flag', '1'); + file_put_contents('message_received.txt', $message); }; $response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); if ($response->asSuccess()) { diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 0455a952..10f1c88d 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -166,6 +166,7 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); + $this->logger->info("Received message content: " . json_encode($response)); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); From 292f9420d3393153cb1af45136dfbb9c16c4aca7 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:46:28 -0800 Subject: [PATCH 33/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 10f1c88d..f7698647 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -166,7 +166,7 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: " . json_encode($response)); + $this->logger->info("Received message content: $response\n"); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); From 39a351d099279c71e590da9f49081207e75cc0c8 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:48:40 -0800 Subject: [PATCH 34/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index f7698647..5e018aa1 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -166,7 +166,8 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: $response\n"); + $this->logger->info("Received message content: $response->getMetadata()\n"); + $this->logger->info("Received message content: " . json_encode($response->getMetadata())); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); From 1c4346b38bd17b7017b84f4fd0f07e7047be8994 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:50:51 -0800 Subject: [PATCH 35/64] fix: example run --- examples/message_received.txt | 0 src/Topic/Internal/ScsTopicClient.php | 3 +-- src/Topic/TopicClient.php | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 examples/message_received.txt diff --git a/examples/message_received.txt b/examples/message_received.txt new file mode 100644 index 00000000..e69de29b diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 5e018aa1..10f1c88d 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -166,8 +166,7 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: $response->getMetadata()\n"); - $this->logger->info("Received message content: " . json_encode($response->getMetadata())); + $this->logger->info("Received message content: " . json_encode($response)); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index 59cfc703..73b73049 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -66,6 +66,6 @@ public function publish(string $cacheName, string $topicName, string $message): public function subscribe(string $cacheName, string $topicName, callable $onMessage): TopicSubscribeResponse { $this->logger->info("Subscribing to topic: $topicName\n"); - return $this->topicClient->subscribe($cacheName, $topicName, $onMessage); + return $this->topicClient->subscribe($cacheName, $topicName, $onMessage)->wait(); } } From 9cedfd657ae449e602bd52476a971019541d0ac8 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:53:07 -0800 Subject: [PATCH 36/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 10f1c88d..be82a97d 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -165,6 +165,8 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { + $this->logger->info("Received raw message: " . var_export($response, true)); + $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); $this->logger->info("Received message content: " . json_encode($response)); $onMessage($response); From b128d08dddd3702a0fa534e86649462d76b94c14 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 16:55:31 -0800 Subject: [PATCH 37/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index be82a97d..743f75ed 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -165,10 +165,10 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { - $this->logger->info("Received raw message: " . var_export($response, true)); + $messageContent = $response->getText(); $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: " . json_encode($response)); + $this->logger->info("Received message content: " . $messageContent); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); From addb8302459f82aa4ec274e74c07ecab6e78af2d Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 17:02:20 -0800 Subject: [PATCH 38/64] fix: example run --- src/Topic/Internal/ScsTopicClient.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 743f75ed..bea96ce4 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -165,10 +165,15 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { - $messageContent = $response->getText(); + $messageItem = $response->getItem(); + $this->logger->info("Received message item: " . json_encode($messageItem)); + $messageValue = $messageItem->getValue(); + $this->logger->info("Received message value: " . json_encode($messageValue)); + $messageText = $messageValue->getText(); + $this->logger->info("Received message text: " . json_encode($messageText)); $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: " . $messageContent); + $this->logger->info("Received message content: " . $messageText); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); From 8438a05adb118aed21c956c86ff4465b031ce9c4 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 17:04:39 -0800 Subject: [PATCH 39/64] fix: example run --- examples/message_received.txt | 0 examples/topic-example.php | 10 ++++++++-- src/Topic/Internal/ScsTopicClient.php | 18 +++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 examples/message_received.txt diff --git a/examples/message_received.txt b/examples/message_received.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/topic-example.php b/examples/topic-example.php index 5525cdb5..2d3e8547 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -45,8 +45,14 @@ function printBanner(string $message, LoggerInterface $logger): void // Subscribe to topic $logger->info("Subscribing to topic: $TOPIC_NAME\n"); $onMessage = function ($message) use ($logger) { - $logger->info("Received message: " . json_encode($message)); - file_put_contents('message_received.txt', $message); + $messageItem = $message->getItem(); + $this->logger->info("Received message item: " . json_encode($messageItem)); + $messageValue = $messageItem->getValue(); + $this->logger->info("Received message value: " . json_encode($messageValue)); + $messageText = $messageValue->getText(); + $this->logger->info("Received message content: " . $messageText); +// $logger->info("Received message: " . json_encode($message)); + file_put_contents('message_received.txt', $messageText); }; $response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); if ($response->asSuccess()) { diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index bea96ce4..5c30e68a 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -165,15 +165,15 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { - $messageItem = $response->getItem(); - $this->logger->info("Received message item: " . json_encode($messageItem)); - $messageValue = $messageItem->getValue(); - $this->logger->info("Received message value: " . json_encode($messageValue)); - $messageText = $messageValue->getText(); - $this->logger->info("Received message text: " . json_encode($messageText)); - - $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: " . $messageText); +// $messageItem = $response->getItem(); +// $this->logger->info("Received message item: " . json_encode($messageItem)); +// $messageValue = $messageItem->getValue(); +// $this->logger->info("Received message value: " . json_encode($messageValue)); +// $messageText = $messageValue->getText(); +// $this->logger->info("Received message text: " . json_encode($messageText)); +// +// $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); +// $this->logger->info("Received message content: " . $messageText); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); From 090631194eff7c7b7cec23eec60a0a23f05bc6d5 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Wed, 3 Jan 2024 17:08:30 -0800 Subject: [PATCH 40/64] fix: example run --- examples/topic-example.php | 10 ++-------- src/Topic/Internal/ScsTopicClient.php | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 2d3e8547..5525cdb5 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -45,14 +45,8 @@ function printBanner(string $message, LoggerInterface $logger): void // Subscribe to topic $logger->info("Subscribing to topic: $TOPIC_NAME\n"); $onMessage = function ($message) use ($logger) { - $messageItem = $message->getItem(); - $this->logger->info("Received message item: " . json_encode($messageItem)); - $messageValue = $messageItem->getValue(); - $this->logger->info("Received message value: " . json_encode($messageValue)); - $messageText = $messageValue->getText(); - $this->logger->info("Received message content: " . $messageText); -// $logger->info("Received message: " . json_encode($message)); - file_put_contents('message_received.txt', $messageText); + $logger->info("Received message: " . json_encode($message)); + file_put_contents('message_received.txt', $message); }; $response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); if ($response->asSuccess()) { diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 5c30e68a..d2106edc 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -174,6 +174,7 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo // // $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); // $this->logger->info("Received message content: " . $messageText); + $this->logger->info("Received message content: " . json_encode($response)); $onMessage($response); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); From b5a2eca0164c3086f94717c75d5394be3879aa70 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 10:00:09 -0800 Subject: [PATCH 41/64] feat: add check for heartbeat message --- src/Topic/Internal/ScsTopicClient.php | 80 ++++----------------------- 1 file changed, 10 insertions(+), 70 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index d2106edc..c56fec49 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -157,6 +157,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess return ResponseFuture::createResolved(new TopicSubscribeResponseError(new UnknownError($e->getMessage(), 0, $e))); } + $firstMessageReceived = false; return ResponseFuture::createPending( function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeResponse { try { @@ -174,6 +175,15 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo // // $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); // $this->logger->info("Received message content: " . $messageText); + + // Check if the first message is a heartbeat + if (!$firstMessageReceived) { + $this->logger->info("First message received: " . json_encode($response)); + $firstMessageReceived = true; + continue; // Skip processing the heartbeat + } + + $this->logger->info("Received message content: " . json_encode($response)); $onMessage($response); } catch (\Exception $e) { @@ -191,76 +201,6 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo ); } - - - - - - -// /** -// * Subscribe to a topic in a cache. -// * -// * @param string $cacheName The name of the cache. -// * @param string $topicName The name of the topic to subscribe to. -// * @param callable $onMessage Callback for handling incoming messages. -// * @return TopicSubscribeResponse -// */ -// public function subscribe(string $cacheName, string $topicName, callable $onMessage): TopicSubscribeResponse -// { -// $this->logger->info("Subscribing to topic: $topicName in cache $cacheName\n"); -// -// try { -// validateCacheName($cacheName); -// -// $authToken = $this->authToken; -// $metadata = [ -// 'authorization' => [$authToken], -// ]; -// -// $request = new _SubscriptionRequest(); -// $request->setCacheName($cacheName); -// $request->setTopic($topicName); -// -// try { -// $call = $this->grpcManager->client->Subscribe($request, $metadata); -// } catch (Exception $e) { -// $this->logger->error("Error during gRPC Subscribe: " . $e->getMessage()); -// throw $e; -// } -// -//// $this->processStreamingCall($call); -// $this->logger->info("Streaming call initiated successfully."); -// $this->logger->info("Waiting for messages...\n"); -// -// $this->logger->info("Before foreach"); -// try{ -// foreach ($call->responses() as $response) { -// $this->logger->info("inside for loop"); -// $this->logger->info("Received message content: " . json_encode($response)); -// try { -// $this->logger->info("Before calling onMessage"); -// $onMessage($response); -// $this->logger->info("After calling onMessage"); -// } catch (\Exception $e) { -// $this->logger->error("Error processing message: " . $e->getMessage()); -// } -// } -// } catch (\Exception $e){ -// $this->logger->error("Exception in response stream: " . $e->getMessage()); -// } -// -// -// } catch (SdkError $e) { -// $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); -// return new TopicSubscribeResponseError($e); -// } catch (\Exception $e) { -// $this->logger->debug("Failed to subscribe to topic $topicName in cache $cacheName: {$e->getMessage()}"); -// return new TopicSubscribeResponseError(new UnknownError($e->getMessage())); -// } -// -// return new TopicSubscribeResponseSubscription(); -// } - public function close(): void { $this->grpcManager->close(); From f185af5dcd9fdce82dbdd23f706b71a70b7df86c Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 10:07:58 -0800 Subject: [PATCH 42/64] feat: add check for heartbeat message --- src/Topic/Internal/ScsTopicClient.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index c56fec49..86ca78a7 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -41,6 +41,7 @@ class ScsTopicClient implements LoggerAwareInterface private LoggerInterface $logger; private int $timeout; private $authToken; + private $firstMessageReceived = false; public function __construct(IConfiguration $configuration, ICredentialProvider $authProvider) { @@ -157,7 +158,7 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess return ResponseFuture::createResolved(new TopicSubscribeResponseError(new UnknownError($e->getMessage(), 0, $e))); } - $firstMessageReceived = false; + return ResponseFuture::createPending( function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeResponse { try { @@ -177,7 +178,7 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo // $this->logger->info("Received message content: " . $messageText); // Check if the first message is a heartbeat - if (!$firstMessageReceived) { + if (!$this->firstMessageReceived) { $this->logger->info("First message received: " . json_encode($response)); $firstMessageReceived = true; continue; // Skip processing the heartbeat From 62ad4e0e33f34339186dd947646c0f80481d13ad Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 10:13:46 -0800 Subject: [PATCH 43/64] feat: add check for heartbeat message --- src/Topic/Internal/ScsTopicClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 86ca78a7..eef80128 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -180,7 +180,7 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo // Check if the first message is a heartbeat if (!$this->firstMessageReceived) { $this->logger->info("First message received: " . json_encode($response)); - $firstMessageReceived = true; + $this->firstMessageReceived = true; continue; // Skip processing the heartbeat } From 51bd2660a50992030263d0de414408a121904d25 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 11:53:52 -0800 Subject: [PATCH 44/64] feat: add check for heartbeat message --- examples/topic-example.php | 10 ++++++++-- src/Topic/Internal/ScsTopicClient.php | 11 +---------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 5525cdb5..b901e665 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -45,9 +45,15 @@ function printBanner(string $message, LoggerInterface $logger): void // Subscribe to topic $logger->info("Subscribing to topic: $TOPIC_NAME\n"); $onMessage = function ($message) use ($logger) { - $logger->info("Received message: " . json_encode($message)); - file_put_contents('message_received.txt', $message); + if (is_string($message)) { + $logger->info("Received message onMessage callback: " . json_encode($message)); + file_put_contents('message_received.txt', json_encode($message, JSON_PRETTY_PRINT)); + } else { + $messageType = gettype($message); + $logger->info("Received message of type $messageType: " . json_encode($message, JSON_PRETTY_PRINT)); + } }; + $response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); if ($response->asSuccess()) { $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index eef80128..a808d81b 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -177,16 +177,7 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo // $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); // $this->logger->info("Received message content: " . $messageText); - // Check if the first message is a heartbeat - if (!$this->firstMessageReceived) { - $this->logger->info("First message received: " . json_encode($response)); - $this->firstMessageReceived = true; - continue; // Skip processing the heartbeat - } - - - $this->logger->info("Received message content: " . json_encode($response)); - $onMessage($response); + $this->logger->info($response->getKind()); } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); } From 288e9bf481f772ffc99c78f0c9cccc249be5b3c1 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 12:00:22 -0800 Subject: [PATCH 45/64] feat: add check for heartbeat message --- src/Topic/Internal/ScsTopicClient.php | 28 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index a808d81b..60290e6e 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -167,17 +167,23 @@ function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeRespo foreach ($call->responses() as $response) { try { -// $messageItem = $response->getItem(); -// $this->logger->info("Received message item: " . json_encode($messageItem)); -// $messageValue = $messageItem->getValue(); -// $this->logger->info("Received message value: " . json_encode($messageValue)); -// $messageText = $messageValue->getText(); -// $this->logger->info("Received message text: " . json_encode($messageText)); -// -// $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); -// $this->logger->info("Received message content: " . $messageText); - - $this->logger->info($response->getKind()); + if (!$this->firstMessageReceived && $response->getKind() === "heartbeat") { + $this->logger->info("Received heartbeat from topic $topicName in cache $cacheName\n"); + $this->firstMessageReceived = true; + continue; + } + + if ($response->getKind() === "item") { + $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); + $this->logger->info("Received message content: " . $response->getItem()->getValue()->getText()); + } else if($response->getKind() === "discontinuity") { + $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); + $this->logger->info("Received message content: " . $response->getDiscontinuity()->getReason()); + } + else { + $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); + $this->logger->info("Received message content: " . $response->getKind()); + } } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); } From 768c3125d3e30452852381fce3ae5e65299d98e4 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 12:57:46 -0800 Subject: [PATCH 46/64] fix: switch instead of if-else --- examples/topic-example.php | 33 +++------ src/Topic/Internal/ScsTopicClient.php | 98 ++++++++------------------- src/Topic/TopicClient.php | 4 +- src/Utilities/_DataValidation.php | 7 ++ 4 files changed, 47 insertions(+), 95 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index b901e665..02a80865 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -44,17 +44,7 @@ function printBanner(string $message, LoggerInterface $logger): void // Subscribe to topic $logger->info("Subscribing to topic: $TOPIC_NAME\n"); -$onMessage = function ($message) use ($logger) { - if (is_string($message)) { - $logger->info("Received message onMessage callback: " . json_encode($message)); - file_put_contents('message_received.txt', json_encode($message, JSON_PRETTY_PRINT)); - } else { - $messageType = gettype($message); - $logger->info("Received message of type $messageType: " . json_encode($message, JSON_PRETTY_PRINT)); - } -}; - -$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME, $onMessage); +$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME); if ($response->asSuccess()) { $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); } elseif ($response->asError()) { @@ -63,22 +53,15 @@ function printBanner(string $message, LoggerInterface $logger): void } // Publish to topic -//$logger->info("Publishing to topic: $TOPIC_NAME\n"); -//$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "MyMessage"); -//if ($response->asSuccess()) { -// $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); -//} elseif ($response->asError()) { -// $logger->info("Error publishing to topic: " . $response->asError()->message() . "\n"); -// exit(1); -//} - -// Wait for a message to be received and logged -$timeout = time() + 60; -while (!file_exists('message_received.flag') && time() < $timeout) { - sleep(1); // Sleep for 1 second before checking again +$logger->info("Publishing to topic: $TOPIC_NAME\n"); +$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "MyMessage"); +if ($response->asSuccess()) { + $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); +} elseif ($response->asError()) { + $logger->info("Error publishing to topic: " . $response->asError()->message() . "\n"); + exit(1); } - // Delete test cache //$logger->info("Deleting cache $CACHE_NAME\n"); //$response = $client->deleteCache($CACHE_NAME); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 60290e6e..b8f101f3 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -7,9 +7,7 @@ use Cache_client\Pubsub\_SubscriptionRequest; use Cache_client\Pubsub\_TopicValue; use Exception; -use Grpc\ServerStreamingCall; use Grpc\UnaryCall; -use http\Env\Response; use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; use Momento\Cache\CacheOperationTypes\TopicPublishResponse; @@ -18,31 +16,33 @@ use Momento\Cache\CacheOperationTypes\TopicSubscribeResponse; use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseError; use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseSubscription; +use Momento\Cache\Errors\InvalidArgumentError; use Momento\Cache\Errors\SdkError; use Momento\Cache\Errors\UnknownError; use Momento\Config\IConfiguration; -use Momento\Requests\CollectionTtl; use Momento\Utilities\_ErrorConverter; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use function Momento\Utilities\validateCacheName; use function Momento\Utilities\validateOperationTimeout; -use function Momento\Utilities\validateTtl; +use function Momento\Utilities\validateTopicName; class ScsTopicClient implements LoggerAwareInterface { private static int $DEFAULT_DEADLINE_MILLISECONDS = 5000; private int $deadline_milliseconds; - // Used to convert deadline_milliseconds into microseconds for gRPC private static int $TIMEOUT_MULTIPLIER = 1000; private int $defaultTtlSeconds; private TopicGrpcManager $grpcManager; private LoggerInterface $logger; private int $timeout; - private $authToken; - private $firstMessageReceived = false; + private string $authToken; + private bool $firstMessageReceived = false; + /** + * @throws InvalidArgumentError + */ public function __construct(IConfiguration $configuration, ICredentialProvider $authProvider) { $this->authToken = $authProvider->getAuthToken(); @@ -62,51 +62,18 @@ public function setLogger(LoggerInterface $logger): void $this->logger = $logger; } - private function ttlToMillis(?int $ttl = null): int - { - if (!$ttl) { - $ttl = $this->defaultTtlSeconds; - } - validateTtl($ttl); - return $ttl * 1000; - } - - private function returnCollectionTtl(?CollectionTtl $ttl): CollectionTtl - { - if (!$ttl) { - return CollectionTtl::fromCacheTtl(); - } - return $ttl; - } - - private function processCall(UnaryCall $call) + /** + * @throws SdkError + */ + private function processCall(UnaryCall $call): void { [$response, $status] = $call->wait(); if ($status->code !== 0) { $this->logger->debug("Topic client error: {$status->details}"); throw _ErrorConverter::convert($status->code, $status->details, $call->getMetadata()); } - return $response; - } - - private function processStreamingCall(ServerStreamingCall $call): void - { - $this->logger->info("Processing streaming call\n"); - foreach ($call->responses() as $response) { - $this->logger->info("Received message: " . json_encode($response)); -// $metadata = $call->getMetadata(); -// $this->logger->info("Initial metadata received: " . json_encode($metadata)); - $this->logger->info("Streaming call initiated successfully."); - } - - $status = $call->getStatus(); - if ($status->code !== 0) { - $this->logger->error("Error during streaming: {$status->details}"); - throw _ErrorConverter::convert($status->code, $status->details, $call->getMetadata()); - } } - public function publish(string $cacheName, string $topicName, string $value): TopicPublishResponse { $this->logger->info("Publishing to topic: $topicName in cache $cacheName\n"); @@ -130,23 +97,19 @@ public function publish(string $cacheName, string $topicName, string $value): To return new TopicPublishResponseSuccess(); } - /** * Subscribe to a topic in a cache. * * @param string $cacheName The name of the cache. * @param string $topicName The name of the topic to subscribe to. - * @param callable $onMessage Callback for handling incoming messages. * @return ResponseFuture */ - public function subscribe(string $cacheName, string $topicName, callable $onMessage): ResponseFuture + public function subscribe(string $cacheName, string $topicName): ResponseFuture { try { validateCacheName($cacheName); - + validateTopicName($topicName); $authToken = $this->authToken; - $this->logger->info("Using auth token: $authToken\n"); - $request = new _SubscriptionRequest(); $request->setCacheName($cacheName); $request->setTopic($topicName); @@ -158,31 +121,30 @@ public function subscribe(string $cacheName, string $topicName, callable $onMess return ResponseFuture::createResolved(new TopicSubscribeResponseError(new UnknownError($e->getMessage(), 0, $e))); } - return ResponseFuture::createPending( - function () use ($call, $onMessage, $topicName, $cacheName): TopicSubscribeResponse { + function () use ($call, $topicName, $cacheName): TopicSubscribeResponse { try { $this->logger->info("Streaming call initiated successfully for topic $topicName in cache $cacheName.\n"); $this->logger->info("Waiting for messages...\n"); foreach ($call->responses() as $response) { try { - if (!$this->firstMessageReceived && $response->getKind() === "heartbeat") { - $this->logger->info("Received heartbeat from topic $topicName in cache $cacheName\n"); - $this->firstMessageReceived = true; - continue; - } - - if ($response->getKind() === "item") { - $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: " . $response->getItem()->getValue()->getText()); - } else if($response->getKind() === "discontinuity") { - $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: " . $response->getDiscontinuity()->getReason()); - } - else { - $this->logger->info("Received message from topic $topicName in cache $cacheName\n"); - $this->logger->info("Received message content: " . $response->getKind()); + switch ($response->getKind()) { + case "heartbeat": + if (!$this->firstMessageReceived) { + $this->logger->info("Received heartbeat from topic $topicName in cache $cacheName\n"); + $this->firstMessageReceived = true; + break; + } + break; + case "item": + $this->logger->info("Received message content: " . $response->getItem()->getValue()->getText()); + break; + case "discontinuity": + $this->logger->info("Received message content: " . $response->getDiscontinuity()->getReason()); + break; + default: + $this->logger->info("Received message content: " . $response->getKind()); } } catch (\Exception $e) { $this->logger->error("Error processing message: " . $e->getMessage()); diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index 73b73049..8b0654f1 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -63,9 +63,9 @@ public function publish(string $cacheName, string $topicName, string $message): return $this->topicClient->publish($cacheName, $topicName, $message); } - public function subscribe(string $cacheName, string $topicName, callable $onMessage): TopicSubscribeResponse + public function subscribe(string $cacheName, string $topicName): TopicSubscribeResponse { $this->logger->info("Subscribing to topic: $topicName\n"); - return $this->topicClient->subscribe($cacheName, $topicName, $onMessage)->wait(); + return $this->topicClient->subscribe($cacheName, $topicName)->wait(); } } diff --git a/src/Utilities/_DataValidation.php b/src/Utilities/_DataValidation.php index 0ec0fbf0..776abd37 100644 --- a/src/Utilities/_DataValidation.php +++ b/src/Utilities/_DataValidation.php @@ -52,6 +52,13 @@ function validateCacheName(string $cacheName): void } } +if (!function_exists('validateTopicName')) { + function validateTopicName(string $topicName): void + { + validateNullOrEmpty($topicName, "Topic name"); + } +} + if (!function_exists('validateKeys')) { function validateKeys(array $keys): void { From 5a5040566f963081622a5c5d8c173e027c0281f7 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 13:11:28 -0800 Subject: [PATCH 47/64] fix: switch instead of if-else --- examples/topic-example.php | 2 +- src/Topic/Internal/ScsTopicClient.php | 45 ++++++++++++++++++++++++++- src/Topic/TopicClient.php | 1 + 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/examples/topic-example.php b/examples/topic-example.php index 02a80865..95b570e4 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -54,7 +54,7 @@ function printBanner(string $message, LoggerInterface $logger): void // Publish to topic $logger->info("Publishing to topic: $TOPIC_NAME\n"); -$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "MyMessage"); +$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, decbin(110101)); if ($response->asSuccess()) { $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); } elseif ($response->asError()) { diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index b8f101f3..d18ca83d 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -5,6 +5,7 @@ use Cache_client\Pubsub\_PublishRequest; use Cache_client\Pubsub\_SubscriptionRequest; +use Cache_client\Pubsub\_TopicItem; use Cache_client\Pubsub\_TopicValue; use Exception; use Grpc\UnaryCall; @@ -138,7 +139,7 @@ function () use ($call, $topicName, $cacheName): TopicSubscribeResponse { } break; case "item": - $this->logger->info("Received message content: " . $response->getItem()->getValue()->getText()); + $this->handleSubscriptionItem($response->getItem()); break; case "discontinuity": $this->logger->info("Received message content: " . $response->getDiscontinuity()->getReason()); @@ -161,6 +162,48 @@ function () use ($call, $topicName, $cacheName): TopicSubscribeResponse { ); } + /** + * Handle the subscription item based on its type. + * + * @param _TopicItem $item The received item from the subscription. + */ + private function handleSubscriptionItem(_TopicItem $item): void + { + try { + $itemType = $item->getValue()->getKind(); + $this->logger->info("Received item type: $itemType"); + + switch ($itemType) { + case "text": + $this->handleTextItem($item->getValue()->getText()); + break; + case "binary": + $this->handleBinaryItem($item->getValue()->getBinary()); + break; + default: + $this->logger->info("Received unknown item type: $itemType"); + } + } catch (\Exception $e) { + $this->logger->error("Error handling subscription item: " . $e->getMessage()); + } + } + + /** + * Handle a text item received during subscription. + * + * @param string $textContent The received text content. + */ + private function handleTextItem(string $textContent): void + { + $this->logger->info("Received message content: $textContent"); + } + + private function handleBinaryItem(string $binaryContent): void + { + $this->logger->info("Received message content: $binaryContent"); + } + + public function close(): void { $this->grpcManager->close(); diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index 8b0654f1..bd95ba84 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -12,6 +12,7 @@ use Momento\Config\IConfiguration; use Momento\Logging\ILoggerFactory; use Momento\Topic\Internal\ScsTopicClient; +use MongoDB\BSON\Binary; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; From b4cd38084aa7743e12b4311448e83a68e542fbc1 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 13:33:24 -0800 Subject: [PATCH 48/64] fix: switch instead of if-else --- src/Topic/TopicClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Topic/TopicClient.php b/src/Topic/TopicClient.php index bd95ba84..9cb7ff14 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/TopicClient.php @@ -64,9 +64,9 @@ public function publish(string $cacheName, string $topicName, string $message): return $this->topicClient->publish($cacheName, $topicName, $message); } - public function subscribe(string $cacheName, string $topicName): TopicSubscribeResponse + public function subscribe(string $cacheName, string $topicName): ResponseFuture { $this->logger->info("Subscribing to topic: $topicName\n"); - return $this->topicClient->subscribe($cacheName, $topicName)->wait(); + return $this->topicClient->subscribe($cacheName, $topicName); } } From 936a692dade6862ce5a560e70dd90d2572e96c53 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 16:09:45 -0800 Subject: [PATCH 49/64] fix: switch instead of if-else --- Dockerfile | 2 + examples/composer.json | 6 ++- examples/topic-example.php | 60 ++++++++++++++++++++------- src/Topic/Internal/ScsTopicClient.php | 1 + 4 files changed, 52 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3a88143..a67740af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM php:8.1.12-cli RUN apt-get update && apt-get install -y -q git rake ruby-ronn zlib1g-dev && apt-get clean +RUN docker-php-ext-install pcntl + RUN cd /usr/local/bin && curl -sS https://getcomposer.org/installer | php RUN cd /usr/local/bin && mv composer.phar composer RUN pecl install grpc diff --git a/examples/composer.json b/examples/composer.json index dabf4ddb..385ce132 100644 --- a/examples/composer.json +++ b/examples/composer.json @@ -1,6 +1,10 @@ { "require": { "momentohq/client-sdk-php": "dev-feat/topic-poc", - "monolog/monolog": "^2.5" + "monolog/monolog": "^3.0", + "ext-pcntl": "*", + "react/event-loop": "^1.5", + "react/promise": "^3.1", + "react/stream": "^1.3" } } diff --git a/examples/topic-example.php b/examples/topic-example.php index 95b570e4..c45cfc9d 100644 --- a/examples/topic-example.php +++ b/examples/topic-example.php @@ -20,6 +20,7 @@ $client = new CacheClient($configuration, $authProvider, $ITEM_DEFAULT_TTL_SECONDS); $topicClient = new TopicClient($configuration, $authProvider); $logger = $configuration->getLoggerFactory()->getLogger("ex:"); +$childLogger = $configuration->getLoggerFactory()->getLogger("ex_child:"); function printBanner(string $message, LoggerInterface $logger): void { @@ -29,6 +30,28 @@ function printBanner(string $message, LoggerInterface $logger): void $logger->info($line); } +function subscribeAndLog(LoggerInterface $childLogger, TopicClient $topicClient, string $cacheName, string $topicName): void +{ + try { + $childLogger->info("Subscription thread started\n"); + + // Loop to keep the thread alive and process incoming messages + while (true) { + $childLogger->info("Inside while loop\n"); + $responseFuture = $topicClient->subscribe($cacheName, $topicName); + $response = $responseFuture->wait(); + + if ($response->asSuccess()) { + $childLogger->info("Received message: " . $response->asSuccess()->message() . "\n"); + } elseif ($response->asError()) { + $childLogger->error("Error receiving message: " . $response->asError()->message() . "\n"); + } + } + } catch (\Throwable $e) { + $childLogger->error("Exception in subscribeAndLog: " . $e->getMessage() . "\n"); + } +} + printBanner("* Momento Example Start *", $logger); // Ensure test cache exists @@ -42,19 +65,30 @@ function printBanner(string $message, LoggerInterface $logger): void $logger->info("Cache " . $CACHE_NAME . " already exists.\n"); } -// Subscribe to topic -$logger->info("Subscribing to topic: $TOPIC_NAME\n"); -$response = $topicClient->subscribe($CACHE_NAME, $TOPIC_NAME); -if ($response->asSuccess()) { - $logger->info("SUCCESS: Subscribed to topic: " . $TOPIC_NAME . "\n"); -} elseif ($response->asError()) { - $logger->info("Error subscribing to topic: " . $response->asError()->message() . "\n"); - exit(1); +// Subscribe to topic in a separate process +$pid = pcntl_fork(); + +if ($pid === -1) { + die('Error forking process'); +} elseif ($pid) { + // Parent process + // Continue execution in the main thread + $logger->info("Back in main thread " . date("h:i:s") . "\n"); + sleep(5); // Sleep for 5 seconds to allow subscription thread to start +} else { + // Child process + // Run the subscription logic in a separate thread + $logger->info("Subscribing to topic: $TOPIC_NAME\n"); + subscribeAndLog($childLogger, $topicClient, $CACHE_NAME, $TOPIC_NAME); + // Exit the child process after handling the subscription +// exit(); } +// Parent process continues here + // Publish to topic $logger->info("Publishing to topic: $TOPIC_NAME\n"); -$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, decbin(110101)); +$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "Hello World " . date("h:i:s")); if ($response->asSuccess()) { $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); } elseif ($response->asError()) { @@ -62,12 +96,6 @@ function printBanner(string $message, LoggerInterface $logger): void exit(1); } -// Delete test cache -//$logger->info("Deleting cache $CACHE_NAME\n"); -//$response = $client->deleteCache($CACHE_NAME); -//if ($response->asError()) { -// $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); -// exit(1); -//} +sleep(10); // Sleep for 10 seconds to allow subscription thread to receive message printBanner("* Momento Example End *", $logger); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index d18ca83d..7abdcb56 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -107,6 +107,7 @@ public function publish(string $cacheName, string $topicName, string $value): To */ public function subscribe(string $cacheName, string $topicName): ResponseFuture { + $this->logger->info("Inside scs topic client subscribe method\n"); try { validateCacheName($cacheName); validateTopicName($topicName); From 6fc469954b51c8c466422e30b70351bf5a2d0b3b Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 16:33:42 -0800 Subject: [PATCH 50/64] fix: testing --- src/Cache/CacheOperationTypes/CacheOperationTypes.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index f455483b..53b425f6 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -199,6 +199,7 @@ protected function isError(): bool protected function isSuccess(): bool { + print get_class($this) . "\n"; return get_class($this) == "{$this->baseType}Success"; } From 29ae98b9c5128ec626fad422b17cf0638b3fecaa Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 16:35:11 -0800 Subject: [PATCH 51/64] fix: testing --- src/Cache/CacheOperationTypes/CacheOperationTypes.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index 53b425f6..62635d8d 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -200,6 +200,7 @@ protected function isError(): bool protected function isSuccess(): bool { print get_class($this) . "\n"; + print "{$this->baseType}\n"; return get_class($this) == "{$this->baseType}Success"; } From 7d2b15299e93a0000a0a2b93dbd26f6aeb697e36 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 16:44:56 -0800 Subject: [PATCH 52/64] fix: response classes --- .../CacheOperationTypes.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index 62635d8d..837e8455 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -209,6 +209,11 @@ protected function isAlreadyExists(): bool return get_class($this) == "{$this->baseType}AlreadyExists"; } + protected function isSubscription(): bool + { + return get_class($this) == "{$this->baseType}Subscription"; + } + protected function isHit(): bool { return get_class($this) == "{$this->baseType}Hit"; @@ -2641,9 +2646,9 @@ class SetRemoveElementError extends SetRemoveElementResponse abstract class TopicPublishResponse extends ResponseBase { /** - * @return TopicPublishResponseSuccess|null + * @return TopicPublishSuccess|null */ - public function asSuccess(): ?TopicPublishResponseSuccess + public function asSuccess(): ?TopicPublishSuccess { if ($this->isSuccess()) { return $this; @@ -2652,9 +2657,9 @@ public function asSuccess(): ?TopicPublishResponseSuccess } /** - * @return TopicPublishResponseError|null Returns the error subtype if the request returned an error and null otherwise. + * @return TopicPublishError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ?TopicPublishResponseError + public function asError(): ?TopicPublishError { if ($this->isError()) { return $this; @@ -2666,14 +2671,14 @@ public function asError(): ?TopicPublishResponseError /** * Indicates that the request that generated it was successful. */ -class TopicPublishResponseSuccess extends TopicPublishResponse +class TopicPublishSuccess extends TopicPublishResponse { } /** * Contains information about an error returned from the request. */ -class TopicPublishResponseError extends TopicPublishResponse +class TopicPublishError extends TopicPublishResponse { use ErrorBody; } @@ -2684,9 +2689,9 @@ abstract class TopicSubscribeResponse extends ResponseBase /** * @return TopicSubscribeResponseSubscription|null */ - public function asSuccess(): ?TopicSubscribeResponseSubscription + public function asSubscription(): ?TopicSubscribeResponseSubscription { - if ($this->isSuccess()) { + if ($this->isSubscription()) { return $this; } return null; From 65374ba9bee1c2a490b48b713eadf4fc899036ba Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 16:47:20 -0800 Subject: [PATCH 53/64] fix: response classes --- src/Topic/Internal/ScsTopicClient.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 7abdcb56..4c25cf8a 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -11,6 +11,7 @@ use Grpc\UnaryCall; use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; +use Momento\Cache\CacheOperationTypes\TopicPublishError; use Momento\Cache\CacheOperationTypes\TopicPublishResponse; use Momento\Cache\CacheOperationTypes\TopicPublishResponseError; use Momento\Cache\CacheOperationTypes\TopicPublishResponseSuccess; @@ -90,12 +91,12 @@ public function publish(string $cacheName, string $topicName, string $value): To $this->processCall($call); } catch (SdkError $e) { $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); - return new TopicPublishResponseError($e); + return new TopicPublishError($e); } catch (\Exception $e) { $this->logger->debug("Failed to publish message to topic $topicName in cache $cacheName: {$e->getMessage()}"); - return new TopicPublishResponseError(new UnknownError($e->getMessage())); + return new TopicPublishError(new UnknownError($e->getMessage())); } - return new TopicPublishResponseSuccess(); + return new TopicPublishSuccess(); } /** From fff2524667a2237e9afdf599f38531dd2516673f Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Thu, 4 Jan 2024 16:49:05 -0800 Subject: [PATCH 54/64] fix: response classes --- src/Topic/Internal/ScsTopicClient.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 4c25cf8a..d1c30300 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -12,9 +12,8 @@ use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; use Momento\Cache\CacheOperationTypes\TopicPublishError; +use Momento\Cache\CacheOperationTypes\TopicPublishSuccess; use Momento\Cache\CacheOperationTypes\TopicPublishResponse; -use Momento\Cache\CacheOperationTypes\TopicPublishResponseError; -use Momento\Cache\CacheOperationTypes\TopicPublishResponseSuccess; use Momento\Cache\CacheOperationTypes\TopicSubscribeResponse; use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseError; use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseSubscription; From 24a88a3d2b32dbbf5664acb2c9068d4f1f625053 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 15:18:37 -0800 Subject: [PATCH 55/64] fix: making topicClient ready for production --- Dockerfile | 3 +- ...-example.php => topic-example-publish.php} | 50 +---------- .../CacheOperationTypes.php | 82 +++++++++++++++-- src/Topic/Internal/ScsTopicClient.php | 88 +++---------------- ...TopicClient.php => PreviewTopicClient.php} | 14 +-- 5 files changed, 100 insertions(+), 137 deletions(-) rename examples/{topic-example.php => topic-example-publish.php} (50%) rename src/Topic/{TopicClient.php => PreviewTopicClient.php} (83%) diff --git a/Dockerfile b/Dockerfile index a67740af..50c9935e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,8 @@ FROM php:8.1.12-cli RUN apt-get update && apt-get install -y -q git rake ruby-ronn zlib1g-dev && apt-get clean -RUN docker-php-ext-install pcntl - RUN cd /usr/local/bin && curl -sS https://getcomposer.org/installer | php RUN cd /usr/local/bin && mv composer.phar composer RUN pecl install grpc RUN docker-php-ext-enable grpc +RUN docker-php-ext-install pcntl diff --git a/examples/topic-example.php b/examples/topic-example-publish.php similarity index 50% rename from examples/topic-example.php rename to examples/topic-example-publish.php index c45cfc9d..c76af328 100644 --- a/examples/topic-example.php +++ b/examples/topic-example-publish.php @@ -7,7 +7,7 @@ use Momento\Cache\CacheClient; use Momento\Config\Configurations\Laptop; use Momento\Logging\StderrLoggerFactory; -use Momento\Topic\TopicClient; +use Momento\Topic\PreviewTopicClient; use Psr\Log\LoggerInterface; $CACHE_NAME = "php-example-cache"; @@ -18,9 +18,8 @@ $authProvider = CredentialProvider::fromEnvironmentVariable("MOMENTO_AUTH_TOKEN"); $configuration = Laptop::latest(new StderrLoggerFactory()); $client = new CacheClient($configuration, $authProvider, $ITEM_DEFAULT_TTL_SECONDS); -$topicClient = new TopicClient($configuration, $authProvider); +$topicClient = new PreviewTopicClient($configuration, $authProvider); $logger = $configuration->getLoggerFactory()->getLogger("ex:"); -$childLogger = $configuration->getLoggerFactory()->getLogger("ex_child:"); function printBanner(string $message, LoggerInterface $logger): void { @@ -30,28 +29,6 @@ function printBanner(string $message, LoggerInterface $logger): void $logger->info($line); } -function subscribeAndLog(LoggerInterface $childLogger, TopicClient $topicClient, string $cacheName, string $topicName): void -{ - try { - $childLogger->info("Subscription thread started\n"); - - // Loop to keep the thread alive and process incoming messages - while (true) { - $childLogger->info("Inside while loop\n"); - $responseFuture = $topicClient->subscribe($cacheName, $topicName); - $response = $responseFuture->wait(); - - if ($response->asSuccess()) { - $childLogger->info("Received message: " . $response->asSuccess()->message() . "\n"); - } elseif ($response->asError()) { - $childLogger->error("Error receiving message: " . $response->asError()->message() . "\n"); - } - } - } catch (\Throwable $e) { - $childLogger->error("Exception in subscribeAndLog: " . $e->getMessage() . "\n"); - } -} - printBanner("* Momento Example Start *", $logger); // Ensure test cache exists @@ -65,27 +42,6 @@ function subscribeAndLog(LoggerInterface $childLogger, TopicClient $topicClient, $logger->info("Cache " . $CACHE_NAME . " already exists.\n"); } -// Subscribe to topic in a separate process -$pid = pcntl_fork(); - -if ($pid === -1) { - die('Error forking process'); -} elseif ($pid) { - // Parent process - // Continue execution in the main thread - $logger->info("Back in main thread " . date("h:i:s") . "\n"); - sleep(5); // Sleep for 5 seconds to allow subscription thread to start -} else { - // Child process - // Run the subscription logic in a separate thread - $logger->info("Subscribing to topic: $TOPIC_NAME\n"); - subscribeAndLog($childLogger, $topicClient, $CACHE_NAME, $TOPIC_NAME); - // Exit the child process after handling the subscription -// exit(); -} - -// Parent process continues here - // Publish to topic $logger->info("Publishing to topic: $TOPIC_NAME\n"); $response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "Hello World " . date("h:i:s")); @@ -96,6 +52,4 @@ function subscribeAndLog(LoggerInterface $childLogger, TopicClient $topicClient, exit(1); } -sleep(10); // Sleep for 10 seconds to allow subscription thread to receive message - printBanner("* Momento Example End *", $logger); diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index 837e8455..080dd137 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -20,10 +20,14 @@ use Cache_client\_SetLengthResponse; use Cache_client\_SetResponse; use Cache_client\ECacheResult; +use Cache_client\Pubsub\_TopicItem; use Closure; use Control_client\_ListCachesResponse; +use Generator; +use Grpc\ServerStreamingCall; use Momento\Cache\Errors\SdkError; use Momento\Cache\Errors\UnknownError; +use Psr\Log\LoggerInterface; use Throwable; trait ErrorBody @@ -2689,7 +2693,7 @@ abstract class TopicSubscribeResponse extends ResponseBase /** * @return TopicSubscribeResponseSubscription|null */ - public function asSubscription(): ?TopicSubscribeResponseSubscription + public function asSubscription(): ?TopicSubscribeSubscription { if ($this->isSubscription()) { return $this; @@ -2698,9 +2702,9 @@ public function asSubscription(): ?TopicSubscribeResponseSubscription } /** - * @return TopicSubscribeResponseError|null Returns the error subtype if the request returned an error and null otherwise. + * @return TopicSubscribeError|null Returns the error subtype if the request returned an error and null otherwise. */ - public function asError(): ?TopicSubscribeResponseError + public function asError(): ?TopicSubscribeError { if ($this->isError()) { return $this; @@ -2712,14 +2716,82 @@ public function asError(): ?TopicSubscribeResponseError /** * Indicates that the request that generated it was successful. */ -class TopicSubscribeResponseSubscription extends TopicSubscribeResponse +class TopicSubscribeSubscription extends TopicSubscribeResponse { + private ServerStreamingCall $call; + private bool $firstMessageReceived; + private string $topicName; + private string $cacheName; + private LoggerInterface $logger; + + public function __construct(ServerStreamingCall $call, string $topicName, string $cacheName, LoggerInterface $logger) + { + parent::__construct(); + $this->call = $call; + $this->firstMessageReceived = false; + $this->cacheName = $cacheName; + $this->topicName = $topicName; + $this->logger = $logger; + } + public function getMessages(): Generator + { + foreach ($this->call->responses() as $response) { + try { + switch ($response->getKind()) { + case "heartbeat": + if (!$this->firstMessageReceived) { + $this->logger->info("Received heartbeat from topic $this->topicName in cache $this->cacheName\n"); + $this->firstMessageReceived = true; + break; + } + break; + case "item": + yield $this->handleSubscriptionItem($response->getItem()); + break; + case "discontinuity": + $this->logger->info("Received message content: " . $response->getDiscontinuity()->getReason()); + break; + default: + $this->logger->info("Received message content: " . $response->getKind()); + } + } catch (\Exception $e) { + $this->logger->error("Error processing message: " . $e->getMessage()); + } + } + } + + /** + * Handle the subscription item based on its type and yield values. + * + * @param _TopicItem $item The received item from the subscription. + * @return string + */ + private function handleSubscriptionItem(_TopicItem $item): string + { + try { + $itemType = $item->getValue()->getKind(); + $this->logger->info("Received item type: $itemType"); + + switch ($itemType) { + case "text": + return $item->getValue()->getText(); + case "binary": + return $item->getValue()->getBinary(); + default: + $this->logger->info("Received unknown item type: $itemType"); + return "Unknown item type: $itemType"; + } + } catch (\Exception $e) { + $this->logger->error("Error handling subscription item: " . $e->getMessage()); + return "Error handling subscription item: " . $e->getMessage(); + } + } } /** * Contains information about an error returned from the request. */ -class TopicSubscribeResponseError extends TopicSubscribeResponse +class TopicSubscribeError extends TopicSubscribeResponse { use ErrorBody; } diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index d1c30300..7bad1ec7 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -8,6 +8,7 @@ use Cache_client\Pubsub\_TopicItem; use Cache_client\Pubsub\_TopicValue; use Exception; +use Grpc\ServerStreamingCall; use Grpc\UnaryCall; use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; @@ -34,12 +35,10 @@ class ScsTopicClient implements LoggerAwareInterface private static int $DEFAULT_DEADLINE_MILLISECONDS = 5000; private int $deadline_milliseconds; private static int $TIMEOUT_MULTIPLIER = 1000; - private int $defaultTtlSeconds; private TopicGrpcManager $grpcManager; private LoggerInterface $logger; private int $timeout; private string $authToken; - private bool $firstMessageReceived = false; /** * @throws InvalidArgumentError @@ -75,6 +74,14 @@ private function processCall(UnaryCall $call): void } } + /** + * Publish to a topic in a cache. + * + * @param string $cacheName The name of the cache. + * @param string $topicName The name of the topic to publish to. + * @param string $value The message to be published. + * @return TopicPublishResponse + */ public function publish(string $cacheName, string $topicName, string $value): TopicPublishResponse { $this->logger->info("Publishing to topic: $topicName in cache $cacheName\n"); @@ -105,9 +112,8 @@ public function publish(string $cacheName, string $topicName, string $value): To * @param string $topicName The name of the topic to subscribe to. * @return ResponseFuture */ - public function subscribe(string $cacheName, string $topicName): ResponseFuture + public function subscribeAsync(string $cacheName, string $topicName): ResponseFuture { - $this->logger->info("Inside scs topic client subscribe method\n"); try { validateCacheName($cacheName); validateTopicName($topicName); @@ -117,6 +123,7 @@ public function subscribe(string $cacheName, string $topicName): ResponseFuture $request->setTopic($topicName); $call = $this->grpcManager->client->Subscribe($request, ['authorization' => [$authToken]]); + $subscription = new TopicSubscribeResponseSubscription($call, $cacheName, $topicName); } catch (SdkError $e) { return ResponseFuture::createResolved(new TopicSubscribeResponseError($e)); } catch (Exception $e) { @@ -124,36 +131,9 @@ public function subscribe(string $cacheName, string $topicName): ResponseFuture } return ResponseFuture::createPending( - function () use ($call, $topicName, $cacheName): TopicSubscribeResponse { + function () use ($subscription, $call, $topicName, $cacheName): TopicSubscribeResponse { try { - $this->logger->info("Streaming call initiated successfully for topic $topicName in cache $cacheName.\n"); - $this->logger->info("Waiting for messages...\n"); - - foreach ($call->responses() as $response) { - try { - switch ($response->getKind()) { - case "heartbeat": - if (!$this->firstMessageReceived) { - $this->logger->info("Received heartbeat from topic $topicName in cache $cacheName\n"); - $this->firstMessageReceived = true; - break; - } - break; - case "item": - $this->handleSubscriptionItem($response->getItem()); - break; - case "discontinuity": - $this->logger->info("Received message content: " . $response->getDiscontinuity()->getReason()); - break; - default: - $this->logger->info("Received message content: " . $response->getKind()); - } - } catch (\Exception $e) { - $this->logger->error("Error processing message: " . $e->getMessage()); - } - } - - return new TopicSubscribeResponseSubscription(); + return $subscription; } catch (SdkError $e) { return new TopicSubscribeResponseError($e); } catch (Exception $e) { @@ -163,48 +143,6 @@ function () use ($call, $topicName, $cacheName): TopicSubscribeResponse { ); } - /** - * Handle the subscription item based on its type. - * - * @param _TopicItem $item The received item from the subscription. - */ - private function handleSubscriptionItem(_TopicItem $item): void - { - try { - $itemType = $item->getValue()->getKind(); - $this->logger->info("Received item type: $itemType"); - - switch ($itemType) { - case "text": - $this->handleTextItem($item->getValue()->getText()); - break; - case "binary": - $this->handleBinaryItem($item->getValue()->getBinary()); - break; - default: - $this->logger->info("Received unknown item type: $itemType"); - } - } catch (\Exception $e) { - $this->logger->error("Error handling subscription item: " . $e->getMessage()); - } - } - - /** - * Handle a text item received during subscription. - * - * @param string $textContent The received text content. - */ - private function handleTextItem(string $textContent): void - { - $this->logger->info("Received message content: $textContent"); - } - - private function handleBinaryItem(string $binaryContent): void - { - $this->logger->info("Received message content: $binaryContent"); - } - - public function close(): void { $this->grpcManager->close(); diff --git a/src/Topic/TopicClient.php b/src/Topic/PreviewTopicClient.php similarity index 83% rename from src/Topic/TopicClient.php rename to src/Topic/PreviewTopicClient.php index 9cb7ff14..d959e3bc 100644 --- a/src/Topic/TopicClient.php +++ b/src/Topic/PreviewTopicClient.php @@ -6,20 +6,17 @@ use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; use Momento\Cache\CacheOperationTypes\TopicPublishResponse; -use Momento\Cache\CacheOperationTypes\TopicSubscribeResponse; -use Momento\Cache\Internal\ScsControlClient; -use Momento\Cache\Internal\ScsDataClient; +use Momento\Cache\Errors\InvalidArgumentError; use Momento\Config\IConfiguration; use Momento\Logging\ILoggerFactory; use Momento\Topic\Internal\ScsTopicClient; -use MongoDB\BSON\Binary; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; /** * Client to perform operations against Momento Serverless Cache. */ -class TopicClient implements LoggerAwareInterface +class PreviewTopicClient implements LoggerAwareInterface { protected IConfiguration $configuration; @@ -27,6 +24,9 @@ class TopicClient implements LoggerAwareInterface protected LoggerInterface $logger; private ScsTopicClient $topicClient; + /** + * @throws InvalidArgumentError + */ public function __construct( IConfiguration $configuration, ICredentialProvider $authProvider ) @@ -64,9 +64,9 @@ public function publish(string $cacheName, string $topicName, string $message): return $this->topicClient->publish($cacheName, $topicName, $message); } - public function subscribe(string $cacheName, string $topicName): ResponseFuture + public function subscribeAsync(string $cacheName, string $topicName): ResponseFuture { $this->logger->info("Subscribing to topic: $topicName\n"); - return $this->topicClient->subscribe($cacheName, $topicName); + return $this->topicClient->subscribeAsync($cacheName, $topicName); } } From 6c571a06d4388019599d7374eb6a955a175dc656 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 15:24:38 -0800 Subject: [PATCH 56/64] fix: making topicClient ready for production --- examples/topic-example-publish.php | 8 ++++ examples/topic-example-subscribe.php | 65 +++++++++++++++++++++++++++ src/Topic/Internal/ScsTopicClient.php | 16 +++---- 3 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 examples/topic-example-subscribe.php diff --git a/examples/topic-example-publish.php b/examples/topic-example-publish.php index c76af328..39dada8a 100644 --- a/examples/topic-example-publish.php +++ b/examples/topic-example-publish.php @@ -52,4 +52,12 @@ function printBanner(string $message, LoggerInterface $logger): void exit(1); } +// Delete test cache +$logger->info("Deleting cache $CACHE_NAME\n"); +$response = $client->deleteCache($CACHE_NAME); +if ($response->asError()) { + $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); + exit(1); +} + printBanner("* Momento Example End *", $logger); diff --git a/examples/topic-example-subscribe.php b/examples/topic-example-subscribe.php new file mode 100644 index 00000000..c6c0363c --- /dev/null +++ b/examples/topic-example-subscribe.php @@ -0,0 +1,65 @@ +getLoggerFactory()->getLogger("ex:"); + +function printBanner(string $message, LoggerInterface $logger): void +{ + $line = "******************************************************************"; + $logger->info($line); + $logger->info($message); + $logger->info($line); +} + +printBanner("* Momento Example Start *", $logger); + +// Ensure test cache exists +$response = $client->createCache($CACHE_NAME); +if ($response->asSuccess()) { + $logger->info("Created cache " . $CACHE_NAME . "\n"); +} elseif ($response->asError()) { + $logger->info("Error creating cache: " . $response->asError()->message() . "\n"); + exit(1); +} elseif ($response->asAlreadyExists()) { + $logger->info("Cache " . $CACHE_NAME . " already exists.\n"); +} + +// Subscribe to topic +$logger->info("Subscribing to topic: $TOPIC_NAME\n"); +$response = $topicClient->subscribeAsync($CACHE_NAME, $TOPIC_NAME); + +// Publish to topic +$logger->info("Publishing to topic: $TOPIC_NAME\n"); +$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "Hello World " . date("h:i:s")); + +$messages = $response->getMessages(); +print "Messages:\n"; +print $messages; + +// Delete test cache +$logger->info("Deleting cache $CACHE_NAME\n"); +$response = $client->deleteCache($CACHE_NAME); +if ($response->asError()) { + $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); + exit(1); +} + +printBanner("* Momento Example End *", $logger); diff --git a/src/Topic/Internal/ScsTopicClient.php b/src/Topic/Internal/ScsTopicClient.php index 7bad1ec7..fd49c36c 100644 --- a/src/Topic/Internal/ScsTopicClient.php +++ b/src/Topic/Internal/ScsTopicClient.php @@ -5,10 +5,8 @@ use Cache_client\Pubsub\_PublishRequest; use Cache_client\Pubsub\_SubscriptionRequest; -use Cache_client\Pubsub\_TopicItem; use Cache_client\Pubsub\_TopicValue; use Exception; -use Grpc\ServerStreamingCall; use Grpc\UnaryCall; use Momento\Auth\ICredentialProvider; use Momento\Cache\CacheOperationTypes\ResponseFuture; @@ -16,8 +14,8 @@ use Momento\Cache\CacheOperationTypes\TopicPublishSuccess; use Momento\Cache\CacheOperationTypes\TopicPublishResponse; use Momento\Cache\CacheOperationTypes\TopicSubscribeResponse; -use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseError; -use Momento\Cache\CacheOperationTypes\TopicSubscribeResponseSubscription; +use Momento\Cache\CacheOperationTypes\TopicSubscribeError; +use Momento\Cache\CacheOperationTypes\TopicSubscribeSubscription; use Momento\Cache\Errors\InvalidArgumentError; use Momento\Cache\Errors\SdkError; use Momento\Cache\Errors\UnknownError; @@ -123,11 +121,11 @@ public function subscribeAsync(string $cacheName, string $topicName): ResponseFu $request->setTopic($topicName); $call = $this->grpcManager->client->Subscribe($request, ['authorization' => [$authToken]]); - $subscription = new TopicSubscribeResponseSubscription($call, $cacheName, $topicName); + $subscription = new TopicSubscribeSubscription($call, $cacheName, $topicName, $this->logger); } catch (SdkError $e) { - return ResponseFuture::createResolved(new TopicSubscribeResponseError($e)); + return ResponseFuture::createResolved(new TopicSubscribeError($e)); } catch (Exception $e) { - return ResponseFuture::createResolved(new TopicSubscribeResponseError(new UnknownError($e->getMessage(), 0, $e))); + return ResponseFuture::createResolved(new TopicSubscribeError(new UnknownError($e->getMessage(), 0, $e))); } return ResponseFuture::createPending( @@ -135,9 +133,9 @@ function () use ($subscription, $call, $topicName, $cacheName): TopicSubscribeRe try { return $subscription; } catch (SdkError $e) { - return new TopicSubscribeResponseError($e); + return new TopicSubscribeError($e); } catch (Exception $e) { - return new TopicSubscribeResponseError(new UnknownError($e->getMessage(), 0, $e)); + return new TopicSubscribeError(new UnknownError($e->getMessage(), 0, $e)); } } ); From c066da8fad218fc308c14f980698299fcdcd842f Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 15:38:22 -0800 Subject: [PATCH 57/64] feat; add example for subscribing to topic --- examples/topic-example-subscribe.php | 41 ++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/examples/topic-example-subscribe.php b/examples/topic-example-subscribe.php index c6c0363c..704dcbc6 100644 --- a/examples/topic-example-subscribe.php +++ b/examples/topic-example-subscribe.php @@ -5,6 +5,8 @@ use Momento\Auth\CredentialProvider; use Momento\Cache\CacheClient; +use Momento\Cache\CacheOperationTypes\TopicSubscribeError; +use Momento\Cache\CacheOperationTypes\TopicSubscribeSubscription; use Momento\Config\Configurations\Laptop; use Momento\Logging\StderrLoggerFactory; use Momento\Topic\PreviewTopicClient; @@ -44,15 +46,44 @@ function printBanner(string $message, LoggerInterface $logger): void // Subscribe to topic $logger->info("Subscribing to topic: $TOPIC_NAME\n"); -$response = $topicClient->subscribeAsync($CACHE_NAME, $TOPIC_NAME); +$subscribeResponseFuture = $topicClient->subscribeAsync($CACHE_NAME, $TOPIC_NAME); // Publish to topic $logger->info("Publishing to topic: $TOPIC_NAME\n"); -$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "Hello World " . date("h:i:s")); +for ($i = 0; $i < 5; $i++) { // publish 5 messages + $publishResponse = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "message-". $i); + if ($publishResponse->asSuccess()) { + $logger->info("SUCCESS: Published message: " . $publishResponse->asSuccess() . "\n"); + } elseif ($publishResponse->asError()) { + $logger->info("Error publishing message: " . $publishResponse->asError()->message() . "\n"); + exit(1); + } +} + +// Counter for received messages +$receivedMessages = 0; + +// Wait for subscription to receive message +$logger->info("Waiting for subscription to receive messages\n"); +$subscribeResponse = $subscribeResponseFuture->wait(); -$messages = $response->getMessages(); -print "Messages:\n"; -print $messages; +if ($subscribeResponse instanceof TopicSubscribeSubscription) { + foreach ($subscribeResponse->getMessages() as $message) { + $logger->info("SUCCESS: Received message: " . $message . "\n"); + $receivedMessages++; + // Exit the loop when the desired number of messages is received otherwise it will hang waiting fpr more messages to be received + if ($receivedMessages >= 5) { + $logger->info("All messages received. Exiting the program.\n"); + break; + } + } +} elseif ($subscribeResponse instanceof TopicSubscribeError) { + $logger->info("Error receiving message: " . $subscribeResponse->message() . "\n"); + exit(1); +} else { + $logger->info("Unexpected response type\n"); + exit(1); +} // Delete test cache $logger->info("Deleting cache $CACHE_NAME\n"); From 43419d704fd55d689a1d0117175916066d1f4d04 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 15:49:29 -0800 Subject: [PATCH 58/64] feat: remove examples --- examples/composer.json | 12 ++-- examples/topic-example-publish.php | 63 ------------------ examples/topic-example-subscribe.php | 96 ---------------------------- 3 files changed, 4 insertions(+), 167 deletions(-) delete mode 100644 examples/topic-example-publish.php delete mode 100644 examples/topic-example-subscribe.php diff --git a/examples/composer.json b/examples/composer.json index 385ce132..4df1990e 100644 --- a/examples/composer.json +++ b/examples/composer.json @@ -1,10 +1,6 @@ { - "require": { - "momentohq/client-sdk-php": "dev-feat/topic-poc", - "monolog/monolog": "^3.0", - "ext-pcntl": "*", - "react/event-loop": "^1.5", - "react/promise": "^3.1", - "react/stream": "^1.3" - } + "require": { + "momentohq/client-sdk-php": "1.4.0", + "monolog/monolog": "^2.5" + } } diff --git a/examples/topic-example-publish.php b/examples/topic-example-publish.php deleted file mode 100644 index 39dada8a..00000000 --- a/examples/topic-example-publish.php +++ /dev/null @@ -1,63 +0,0 @@ -getLoggerFactory()->getLogger("ex:"); - -function printBanner(string $message, LoggerInterface $logger): void -{ - $line = "******************************************************************"; - $logger->info($line); - $logger->info($message); - $logger->info($line); -} - -printBanner("* Momento Example Start *", $logger); - -// Ensure test cache exists -$response = $client->createCache($CACHE_NAME); -if ($response->asSuccess()) { - $logger->info("Created cache " . $CACHE_NAME . "\n"); -} elseif ($response->asError()) { - $logger->info("Error creating cache: " . $response->asError()->message() . "\n"); - exit(1); -} elseif ($response->asAlreadyExists()) { - $logger->info("Cache " . $CACHE_NAME . " already exists.\n"); -} - -// Publish to topic -$logger->info("Publishing to topic: $TOPIC_NAME\n"); -$response = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "Hello World " . date("h:i:s")); -if ($response->asSuccess()) { - $logger->info("SUCCESS: Published to topic: " . $TOPIC_NAME . "\n"); -} elseif ($response->asError()) { - $logger->info("Error publishing to topic: " . $response->asError()->message() . "\n"); - exit(1); -} - -// Delete test cache -$logger->info("Deleting cache $CACHE_NAME\n"); -$response = $client->deleteCache($CACHE_NAME); -if ($response->asError()) { - $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); - exit(1); -} - -printBanner("* Momento Example End *", $logger); diff --git a/examples/topic-example-subscribe.php b/examples/topic-example-subscribe.php deleted file mode 100644 index 704dcbc6..00000000 --- a/examples/topic-example-subscribe.php +++ /dev/null @@ -1,96 +0,0 @@ -getLoggerFactory()->getLogger("ex:"); - -function printBanner(string $message, LoggerInterface $logger): void -{ - $line = "******************************************************************"; - $logger->info($line); - $logger->info($message); - $logger->info($line); -} - -printBanner("* Momento Example Start *", $logger); - -// Ensure test cache exists -$response = $client->createCache($CACHE_NAME); -if ($response->asSuccess()) { - $logger->info("Created cache " . $CACHE_NAME . "\n"); -} elseif ($response->asError()) { - $logger->info("Error creating cache: " . $response->asError()->message() . "\n"); - exit(1); -} elseif ($response->asAlreadyExists()) { - $logger->info("Cache " . $CACHE_NAME . " already exists.\n"); -} - -// Subscribe to topic -$logger->info("Subscribing to topic: $TOPIC_NAME\n"); -$subscribeResponseFuture = $topicClient->subscribeAsync($CACHE_NAME, $TOPIC_NAME); - -// Publish to topic -$logger->info("Publishing to topic: $TOPIC_NAME\n"); -for ($i = 0; $i < 5; $i++) { // publish 5 messages - $publishResponse = $topicClient->publish($CACHE_NAME, $TOPIC_NAME, "message-". $i); - if ($publishResponse->asSuccess()) { - $logger->info("SUCCESS: Published message: " . $publishResponse->asSuccess() . "\n"); - } elseif ($publishResponse->asError()) { - $logger->info("Error publishing message: " . $publishResponse->asError()->message() . "\n"); - exit(1); - } -} - -// Counter for received messages -$receivedMessages = 0; - -// Wait for subscription to receive message -$logger->info("Waiting for subscription to receive messages\n"); -$subscribeResponse = $subscribeResponseFuture->wait(); - -if ($subscribeResponse instanceof TopicSubscribeSubscription) { - foreach ($subscribeResponse->getMessages() as $message) { - $logger->info("SUCCESS: Received message: " . $message . "\n"); - $receivedMessages++; - // Exit the loop when the desired number of messages is received otherwise it will hang waiting fpr more messages to be received - if ($receivedMessages >= 5) { - $logger->info("All messages received. Exiting the program.\n"); - break; - } - } -} elseif ($subscribeResponse instanceof TopicSubscribeError) { - $logger->info("Error receiving message: " . $subscribeResponse->message() . "\n"); - exit(1); -} else { - $logger->info("Unexpected response type\n"); - exit(1); -} - -// Delete test cache -$logger->info("Deleting cache $CACHE_NAME\n"); -$response = $client->deleteCache($CACHE_NAME); -if ($response->asError()) { - $logger->info("Error deleting cache: " . $response->asError()->message() . "\n"); - exit(1); -} - -printBanner("* Momento Example End *", $logger); From 6b6baee4dd96ee7e5f9255b08a3c16dc8e273c3b Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 16:09:35 -0800 Subject: [PATCH 59/64] fix: delete composer.lock --- composer.lock | 4095 ------------------------------------------------- 1 file changed, 4095 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index f3e9bb86..00000000 --- a/composer.lock +++ /dev/null @@ -1,4095 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "a302f7a65e97f346b0f3c88db6ed9138", - "packages": [ - { - "name": "firebase/php-jwt", - "version": "v6.10.0", - "source": { - "type": "git", - "url": "https://github.com/firebase/php-jwt.git", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff", - "shasum": "" - }, - "require": { - "php": "^7.4||^8.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0" - }, - "suggest": { - "ext-sodium": "Support EdDSA (Ed25519) signatures", - "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" - }, - "type": "library", - "autoload": { - "psr-4": { - "Firebase\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Neuman Vong", - "email": "neuman+pear@twilio.com", - "role": "Developer" - }, - { - "name": "Anant Narayanan", - "email": "anant@php.net", - "role": "Developer" - } - ], - "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", - "homepage": "https://github.com/firebase/php-jwt", - "keywords": [ - "jwt", - "php" - ], - "support": { - "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.0" - }, - "time": "2023-12-01T16:26:39+00:00" - }, - { - "name": "google/protobuf", - "version": "v3.22.3", - "source": { - "type": "git", - "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "0edeee0cc2e2991706e16ab60c7d224e5c0241ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0edeee0cc2e2991706e16ab60c7d224e5c0241ba", - "reference": "0edeee0cc2e2991706e16ab60c7d224e5c0241ba", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "phpunit/phpunit": ">=5.0.0" - }, - "suggest": { - "ext-bcmath": "Need to support JSON deserialization" - }, - "type": "library", - "autoload": { - "psr-4": { - "Google\\Protobuf\\": "src/Google/Protobuf", - "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "proto library for PHP", - "homepage": "https://developers.google.com/protocol-buffers/", - "keywords": [ - "proto" - ], - "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v3.22.3" - }, - "time": "2023-04-12T23:38:34+00:00" - }, - { - "name": "grpc/grpc", - "version": "1.52.0", - "source": { - "type": "git", - "url": "https://github.com/grpc/grpc-php.git", - "reference": "98394cd601a587ca68294e6209bd713856969105" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/grpc/grpc-php/zipball/98394cd601a587ca68294e6209bd713856969105", - "reference": "98394cd601a587ca68294e6209bd713856969105", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "google/auth": "^v1.3.0" - }, - "suggest": { - "ext-protobuf": "For better performance, install the protobuf C extension.", - "google/protobuf": "To get started using grpc quickly, install the native protobuf library." - }, - "type": "library", - "autoload": { - "psr-4": { - "Grpc\\": "src/lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "gRPC library for PHP", - "homepage": "https://grpc.io", - "keywords": [ - "rpc" - ], - "support": { - "source": "https://github.com/grpc/grpc-php/tree/v1.52.0" - }, - "time": "2023-02-25T05:20:08+00:00" - }, - { - "name": "psr/log", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" - }, - "time": "2021-07-14T16:46:02+00:00" - }, - { - "name": "psr/simple-cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" - }, - "time": "2021-10-29T13:26:27+00:00" - } - ], - "packages-dev": [ - { - "name": "composer/ca-bundle", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "b66d11b7479109ab547f9405b97205640b17d385" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/b66d11b7479109ab547f9405b97205640b17d385", - "reference": "b66d11b7479109ab547f9405b97205640b17d385", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.4.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-12-18T12:05:55+00:00" - }, - { - "name": "composer/class-map-generator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/composer/class-map-generator.git", - "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", - "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", - "shasum": "" - }, - "require": { - "composer/pcre": "^2.1 || ^3.1", - "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" - }, - "require-dev": { - "phpstan/phpstan": "^1.6", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/filesystem": "^5.4 || ^6", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\ClassMapGenerator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Utilities to scan PHP code and generate class maps.", - "keywords": [ - "classmap" - ], - "support": { - "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.1.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-06-30T13:58:57+00:00" - }, - { - "name": "composer/composer", - "version": "2.6.6", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "683557bd2466072777309d039534bb1332d0dda5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/683557bd2466072777309d039534bb1332d0dda5", - "reference": "683557bd2466072777309d039534bb1332d0dda5", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/class-map-generator": "^1.0", - "composer/metadata-minifier": "^1.0", - "composer/pcre": "^2.1 || ^3.1", - "composer/semver": "^3.2.5", - "composer/spdx-licenses": "^1.5.7", - "composer/xdebug-handler": "^2.0.2 || ^3.0.3", - "justinrainbow/json-schema": "^5.2.11", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "react/promise": "^2.8 || ^3", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.2", - "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.11 || ^6.0.11", - "symfony/filesystem": "^5.4 || ^6.0 || ^7", - "symfony/finder": "^5.4 || ^6.0 || ^7", - "symfony/polyfill-php73": "^1.24", - "symfony/polyfill-php80": "^1.24", - "symfony/polyfill-php81": "^1.24", - "symfony/process": "^5.4 || ^6.0 || ^7" - }, - "require-dev": { - "phpstan/phpstan": "^1.9.3", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1", - "phpstan/phpstan-symfony": "^1.2.10", - "symfony/phpunit-bridge": "^6.0 || ^7" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.6-dev" - }, - "phpstan": { - "includes": [ - "phpstan/rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "https://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/composer/issues", - "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.6.6" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-12-08T17:32:26+00:00" - }, - { - "name": "composer/metadata-minifier", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/metadata-minifier.git", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "composer/composer": "^2", - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\MetadataMinifier\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Small utility library that handles metadata minification and expansion.", - "keywords": [ - "composer", - "compression" - ], - "support": { - "issues": "https://github.com/composer/metadata-minifier/issues", - "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-04-07T13:37:33+00:00" - }, - { - "name": "composer/pcre", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-10-11T07:11:09+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-08-31T09:50:34+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.5.8", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-11-20T07:44:33+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T21:32:43+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "v5.2.13", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" - }, - "time": "2023-09-26T02:20:38+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.18.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" - }, - "time": "2023-12-10T21:03:43+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.30", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca2bd87d2f9215904682a9cb9bb37dda98e76089", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.30" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:47:57+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.6.15", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1 || ^2", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.6-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2023-12-01T16:55:19+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "react/promise", - "version": "v3.1.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", - "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", - "shasum": "" - }, - "require": { - "php": ">=7.1.0" - }, - "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.1.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-11-16T16:21:57+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:41:17+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:19:30+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-05-07T05:35:17+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:03:51+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T06:03:37+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-08-02T09:26:13+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:20:34+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:13:03+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.10.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "76d449a358ece77d6f1d6331c68453e657172202" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/76d449a358ece77d6f1d6331c68453e657172202", - "reference": "76d449a358ece77d6f1d6331c68453e657172202", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.1" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], - "time": "2023-12-18T13:03:25+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" - }, - "time": "2022-08-31T10:31:18+00:00" - }, - { - "name": "seld/signal-handler", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/signal-handler.git", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "require-dev": { - "phpstan/phpstan": "^1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^7.5.20 || ^8.5.23", - "psr/log": "^1 || ^2 || ^3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\Signal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", - "keywords": [ - "posix", - "sigint", - "signal", - "sigterm", - "unix" - ], - "support": { - "issues": "https://github.com/Seldaek/signal-handler/issues", - "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" - }, - "time": "2023-09-03T09:24:00+00:00" - }, - { - "name": "symfony/console", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0254811a143e6bc6c8deea08b589a7e68a37f625", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-10T16:15:48+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-23T14:45:45+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/952a8cb588c3bc6ce76f6023000fb932f16a6e59", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-26T17:27:13+00:00" - }, - { - "name": "symfony/finder", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "11d736e97f116ac375a81f96e662911a34cd50ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/11d736e97f116ac375a81f96e662911a34cd50ce", - "reference": "11d736e97f116ac375a81f96e662911a34cd50ce", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/filesystem": "^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-10-31T17:30:12+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-28T09:04:16+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/process", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c4b1ef0bc80533d87a2e969806172f1c2a980241", - "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-22T16:42:54+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.4.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-26T14:02:43+00:00" - }, - { - "name": "symfony/string", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/7cb80bc10bfcdf6b5492741c0b9357dac66940bc", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-10T16:15:48+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2023-11-20T00:12:19+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.4", - "ext-grpc": "*", - "ext-json": "*" - }, - "platform-dev": [], - "plugin-api-version": "2.6.0" -} From eea068b94d2daf5c5e05e71302b08c9db4f209f1 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 16:14:05 -0800 Subject: [PATCH 60/64] fix; delete print statements from type class --- src/Cache/CacheOperationTypes/CacheOperationTypes.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Cache/CacheOperationTypes/CacheOperationTypes.php b/src/Cache/CacheOperationTypes/CacheOperationTypes.php index 080dd137..9720c5c5 100644 --- a/src/Cache/CacheOperationTypes/CacheOperationTypes.php +++ b/src/Cache/CacheOperationTypes/CacheOperationTypes.php @@ -203,8 +203,6 @@ protected function isError(): bool protected function isSuccess(): bool { - print get_class($this) . "\n"; - print "{$this->baseType}\n"; return get_class($this) == "{$this->baseType}Success"; } From 76adfaddc890d418235911700c030243484aff7c Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 16:19:31 -0800 Subject: [PATCH 61/64] fix: remove installing pcntl from dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 50c9935e..c3a88143 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,3 @@ RUN cd /usr/local/bin && curl -sS https://getcomposer.org/installer | php RUN cd /usr/local/bin && mv composer.phar composer RUN pecl install grpc RUN docker-php-ext-enable grpc -RUN docker-php-ext-install pcntl From 6d4f4e43ac21a3a781bc04ef22e05825a76fcbf2 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 16:20:23 -0800 Subject: [PATCH 62/64] fix: remove DS_Store --- types/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 types/.DS_Store diff --git a/types/.DS_Store b/types/.DS_Store deleted file mode 100644 index 222d2fb4db7bdc7e2100149b185c75e881af8355..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5PegFv{a-=FG7An!GDm(1o0q<{s6U!P+>Ko={IHcv=6FOsV7w0)9GaN|rhqB13koo2 ztBt1ttu+Nq0aIY3fPNoRx?&cw3+O)`Y-x^+3twJH6UuBQ9CfEx-sJ{5DXrs5;IH_oTpA!ZS~fSjS(kARoK K8dKm;75D`7(pl>O From 432bf2edfc95d6b80ac5c8eaf94ac94dd3f09b58 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Fri, 5 Jan 2024 16:24:29 -0800 Subject: [PATCH 63/64] fix: remove DS_Store --- .DS_Store | Bin 8196 -> 0 bytes .gitignore | 1 + 2 files changed, 1 insertion(+) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 591fb70a16e32ba002745ff2b50d3fce83246174..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHM&2G~`5T0#Xa0t-wQ>jQGS>oD;rid1aOGs0p9{5pH-~gz^acE5)JH$ytR7J`i zo`F~3%!9zYaDs1k-O64kNL&zAcctA~ujiYc{bp@vHbf+FbrfF;N1NZHIccusgugzBU}Yre%N&U(18{| zSPxN4zhpsgGSUaGNe3G8tA?DX4SGsXXot3Gi>mY-y)9fn!r4Ka+%#I;($Lq)#W}+v zEknxL=Hw{&Je#KfUDGc>Zy%NY_TX6w=r;LjRBl5<6(^&B zc3}l8Oygy|za-*apbuD?3qJ$Y5)Gxt+N{K}PNJ?L#+$HJqsNfTSYHT+_b_9Cc3QlX z7OrX*I*3n*6%YSlgQK0aF|XNpMsFnh9MdHFVhYXYTfF|vPL**@;_@0Ui{Qv6 z5$Uy-?%a9HvI^Fl`hGa5_Zq!^RBd!$@zqWk`p$8`;k@u#gWclw zjWFmnyr9*U0MBhf<@HN1aKk}0><4Znv2}IB%IEXD#T!RQt9RFy?A4X>Xvsb*m)Gwv z+3V$dqfy>kxP9lr_U?h-4np1}C?ftHTD?{UZrV4Eb8Q>-Eh-n*8!IUxXk Date: Mon, 8 Jan 2024 10:32:20 -0800 Subject: [PATCH 64/64] fix: build test --- src/Cache/Psr16CacheClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cache/Psr16CacheClient.php b/src/Cache/Psr16CacheClient.php index a42a851f..60fea69b 100644 --- a/src/Cache/Psr16CacheClient.php +++ b/src/Cache/Psr16CacheClient.php @@ -111,7 +111,7 @@ public function getLastError(bool $clear_error = true): ?CacheException /** * @inheritDoc */ - public function get($key, $default = null) + public function get($key, $default = null): mixed { validatePsr16Key($key); $response = $this->momento->get($this->cacheName, $key);