From 1dded78ef6a9143e6b6c6866596097e917ee7395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Mon, 25 Apr 2022 16:45:36 +0200 Subject: [PATCH 1/7] build: remove alias.php from autoloader --- composer.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/composer.json b/composer.json index 87438a71..104d0473 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ }, "require": { "php": ">=7.2.0", - "guzzlehttp/streams": "^3.0", "guzzlehttp/guzzle": "^7.2", "composer/semver": "^3.2" }, @@ -24,9 +23,6 @@ "psr-4": { "Google\\AppEngine\\": "src" }, - "files": [ - "src/aliases.php" - ], "classmap": [ "src/Api/api_base_pb.php", "src/Api/AppIdentity/app_identity_service_pb.php", From 4f44c4ca014c26962e8847b9447125c447e3f7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Mon, 25 Apr 2022 16:48:39 +0200 Subject: [PATCH 2/7] build: remove unnecessary class_alias from alias.php --- src/aliases.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/aliases.php b/src/aliases.php index b37f28d5..cd1c3bf0 100644 --- a/src/aliases.php +++ b/src/aliases.php @@ -23,16 +23,6 @@ $classMap = [ 'Google\AppEngine\Api\AppIdentity\AppIdentityService' => 'google\appengine\api\app_identity\AppIdentityService', - 'Google\AppEngine\Api\Modules\InvalidModuleStateException' => 'google\appengine\api\modules\InvalidModuleStateException', - 'Google\AppEngine\Api\Modules\ModulesException' => 'google\appengine\api\modules\ModulesException', - 'Google\AppEngine\Api\Modules\ModulesService' => 'google\appengine\api\modules\ModulesService', - 'Google\AppEngine\Api\Modules\TransientModulesException' => 'google\appengine\api\modules\TransientModulesException', - 'Google\AppEngine\Api\TaskQueue\PushTask' => 'google\appengine\api\taskqueue\PushTask', - 'Google\AppEngine\Api\TaskQueue\PushQueue' => 'google\appengine\api\taskqueue\PushQueue', - 'Google\AppEngine\Api\Users\User' => 'google\appengine\api\users\User', - 'Google\AppEngine\Api\Users\UserService' => 'google\appengine\api\users\UserService', - 'Google\AppEngine\Api\Users\UserServiceUtil' => 'google\appengine\api\users\UserServiceUtil', - 'Google\AppEngine\Api\Users\UsersException' =>'google\appengine\api\users\UsersException' ]; foreach ($classMap as $class => $alias) { From 06fe3e1f411a654664c3ba45174ad09f7759c469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Mon, 25 Apr 2022 16:59:00 +0200 Subject: [PATCH 3/7] build: remove not used "composer/semver" dependency --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 104d0473..d11d8930 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,7 @@ }, "require": { "php": ">=7.2.0", - "guzzlehttp/guzzle": "^7.2", - "composer/semver": "^3.2" + "guzzlehttp/guzzle": "^7.2" }, "require-dev": { "phpunit/phpunit": "^8", From e524581658ece599fe46c26a28058342f7063a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Thu, 26 Jan 2023 11:33:21 +0100 Subject: [PATCH 4/7] fix: php 8 deprecation warning --- src/Ext/Session/MemcacheSessionHandler.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Ext/Session/MemcacheSessionHandler.php b/src/Ext/Session/MemcacheSessionHandler.php index 239baaaa..0c0c5b72 100644 --- a/src/Ext/Session/MemcacheSessionHandler.php +++ b/src/Ext/Session/MemcacheSessionHandler.php @@ -63,6 +63,7 @@ public function __construct($memcacheContainer = null) { * @param string $sessionName Not ued * @return bool true if successful, false otherwise */ + #[\ReturnTypeWillChange] public function open($savePath, $sessionName) { return true; } @@ -71,6 +72,7 @@ public function open($savePath, $sessionName) { * Closes the session handler. * @return bool true if successful, false otherwise */ + #[\ReturnTypeWillChange] public function close() { return $this->memcacheContainer->close(); } @@ -80,6 +82,7 @@ public function close() { * @param string $id Session ID associated with the data to be retrieved * @return string data associated with that ID or empty string on failure */ + #[\ReturnTypeWillChange] public function read($id) { $data = $this->memcacheContainer->get(self::SESSION_PREFIX . $id); return empty($data) ? '' : $data; @@ -91,6 +94,7 @@ public function read($id) { * @param string $data Data to be stored * @return bool true if successful, false otherwise */ + #[\ReturnTypeWillChange] public function write($id, $data) { return $this->memcacheContainer->set( self::SESSION_PREFIX . $id, $data, $this->expire); @@ -101,6 +105,7 @@ public function write($id, $data) { * @param string $id Session ID associated with the data to be destroyed * @return bool true if successful, false otherwise */ + #[\ReturnTypeWillChange] public function destroy($id) { return $this->memcacheContainer->delete( self::SESSION_PREFIX . $id); @@ -112,6 +117,7 @@ public function destroy($id) { * @param int $maxlifetime Not used * @return bool true if successful, false otherwise */ + #[\ReturnTypeWillChange] public function gc($maxlifetime) { // Handled by "expire" in Memcache. return true; From f218bd2b146d1c3faa8ed72b4b29e719540426f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Fri, 27 Jan 2023 11:47:59 +0100 Subject: [PATCH 5/7] fix: rollback composer.json file loader --- composer.json | 3 +++ src/aliases.php | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index d11d8930..adb13826 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,9 @@ "psr-4": { "Google\\AppEngine\\": "src" }, + "files": [ + "src/aliases.php" + ], "classmap": [ "src/Api/api_base_pb.php", "src/Api/AppIdentity/app_identity_service_pb.php", diff --git a/src/aliases.php b/src/aliases.php index cd1c3bf0..caaa2041 100644 --- a/src/aliases.php +++ b/src/aliases.php @@ -21,10 +21,4 @@ * included in the autoloader inside the composer.json. */ -$classMap = [ - 'Google\AppEngine\Api\AppIdentity\AppIdentityService' => 'google\appengine\api\app_identity\AppIdentityService', -]; - -foreach ($classMap as $class => $alias) { - @class_alias($class, $alias); -} +@class_alias('Google\AppEngine\Api\AppIdentity\AppIdentityService', 'google\appengine\api\app_identity\AppIdentityService'); From 0ef8521b583951cdd902e8c7d48a1db2b79391f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Sat, 28 Jan 2023 16:56:37 +0100 Subject: [PATCH 6/7] build: restore guzzlehttp/streams dependency used in UrlFetch API --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index adb13826..1f16c12e 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ }, "require": { "php": ">=7.2.0", + "guzzlehttp/streams": "^3.0", "guzzlehttp/guzzle": "^7.2" }, "require-dev": { From 9d30dd1def93a23a603273d9a5e5a9bc0ecaa30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mar=C3=ADn?= Date: Sat, 28 Jan 2023 17:08:04 +0100 Subject: [PATCH 7/7] fix: Cannot declare class google\appengine\api\app_identity\AppIdentityService, because the name is already in use --- src/aliases.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/aliases.php b/src/aliases.php index caaa2041..c8b98fc7 100644 --- a/src/aliases.php +++ b/src/aliases.php @@ -15,10 +15,12 @@ * limitations under the License. */ /** - * Alias.php creates aliases for the classes to match the + * Alias.php creates aliases for the classes to match the * original names used in the php55 sdk. This is for the - * convenience of migration to php7+ sdk. Alias.php is + * convenience of migration to php7+ sdk. Alias.php is * included in the autoloader inside the composer.json. */ -@class_alias('Google\AppEngine\Api\AppIdentity\AppIdentityService', 'google\appengine\api\app_identity\AppIdentityService'); +if (!class_exists('google\appengine\api\app_identity\AppIdentityService')) { + @class_alias('Google\AppEngine\Api\AppIdentity\AppIdentityService', 'google\appengine\api\app_identity\AppIdentityService'); +}