Skip to content

Commit 206f698

Browse files
Arthur Moglievwing328
andauthored
[php-ze-ph][php-mezzio-ph] Migration from Zend to Laminas and corresponding generator rename (#8145)
* Migration from php-ze-ph to php-mezzio-ph * Sample regen after rebase * update samples Co-authored-by: William Cheng <wing328hk@gmail.com>
1 parent d1dcdad commit 206f698

198 files changed

Lines changed: 733 additions & 3864 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.test/samples.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@
807807
]
808808
},
809809
{
810-
"input": "php-ze-ph-petstore-server.sh",
810+
"input": "php-mezzio-ph-petstore-server.sh",
811811
"matches": [
812812
"Server: PHP"
813813
]

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ samples/client/petstore/python-tornado/.venv/
176176
# PHP
177177
samples/client/petstore/php/OpenAPIClient-php/composer.lock
178178
samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
179-
samples/openapi3/server/petstore/php-ze-ph/composer.lock
179+
samples/openapi3/server/petstore/php-mezzio-ph/composer.lock
180180
samples/server/petstore/php-laravel/lib/composer.lock
181181
samples/server/petstore/php-lumen/lib/composer.lock
182182
samples/server/petstore/php-slim4/composer.lock
183183
samples/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
184-
samples/server/petstore/php-ze-ph/composer.lock
184+
samples/server/petstore/php-mezzio-ph/composer.lock
185185

186186
# ts
187187
samples/client/petstore/typescript-angular2/npm/npm-debug.log

bin/configs/php-mezzio-ph.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
generatorName: php-mezzio-ph
2+
outputDir: samples/server/petstore/php-mezzio-ph
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/php-mezzio-ph

bin/configs/php-ze-ph.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/generators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ The following generators are available:
107107
* [nodejs-express-server (beta)](generators/nodejs-express-server.md)
108108
* [php-laravel](generators/php-laravel.md)
109109
* [php-lumen](generators/php-lumen.md)
110+
* [php-mezzio-ph](generators/php-mezzio-ph.md)
110111
* [php-silex-deprecated (deprecated)](generators/php-silex-deprecated.md)
111112
* [php-slim-deprecated (deprecated)](generators/php-slim-deprecated.md)
112113
* [php-slim4](generators/php-slim4.md)
113114
* [php-symfony](generators/php-symfony.md)
114-
* [php-ze-ph](generators/php-ze-ph.md)
115115
* [python-aiohttp](generators/python-aiohttp.md)
116116
* [python-blueplanet](generators/python-blueplanet.md)
117117
* [python-flask](generators/python-flask.md)

docs/generators/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ The following generators are available:
9696
* [nodejs-express-server (beta)](nodejs-express-server.md)
9797
* [php-laravel](php-laravel.md)
9898
* [php-lumen](php-lumen.md)
99+
* [php-mezzio-ph](php-mezzio-ph.md)
99100
* [php-slim4](php-slim4.md)
100101
* [php-symfony](php-symfony.md)
101-
* [php-ze-ph](php-ze-ph.md)
102102
* [python-aiohttp](python-aiohttp.md)
103103
* [python-blueplanet](python-blueplanet.md)
104104
* [python-flask](python-flask.md)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Config Options for php-ze-ph
3-
sidebar_label: php-ze-ph
2+
title: Config Options for php-mezzio-ph
3+
sidebar_label: php-mezzio-ph
44
---
55

66
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.

docs/migration-from-swagger-codegen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ All languages of `swagger-codegen` have been migrated to `openapi-generator`, bu
129129
| `swift` | `swift2-deprecated` |
130130
| `lumen` | `php-lumen` |
131131
| `slim` | `php-slim` |
132-
| `ze-ph` | `php-ze-ph` |
132+
| `ze-ph` | `php-mezzio-ph` |
133133
| `nancyfx` | `csharp-nancyfx` |
134134

135135
We provide a temporary mapping in code for these old values. You'll receive a warning with instructions to migrate to the new names.

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpZendExpressivePathHandlerServerCodegen.java renamed to modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpMezzioPathHandlerServerCodegen.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
import java.io.File;
3434
import java.util.*;
3535

36-
public class PhpZendExpressivePathHandlerServerCodegen extends AbstractPhpCodegen {
37-
private static final Logger LOGGER = LoggerFactory.getLogger(PhpZendExpressivePathHandlerServerCodegen.class);
36+
public class PhpMezzioPathHandlerServerCodegen extends AbstractPhpCodegen {
37+
private static final Logger LOGGER = LoggerFactory.getLogger(PhpMezzioPathHandlerServerCodegen.class);
3838

3939
// TODO: Rename to x- prefixed vendor extensions, per specification.
4040
public static final String VEN_FROM_QUERY = "internal.ze-ph.fromQuery";
@@ -49,15 +49,15 @@ public CodegenType getTag() {
4949

5050
@Override
5151
public String getName() {
52-
return "php-ze-ph";
52+
return "php-mezzio-ph";
5353
}
5454

5555
@Override
5656
public String getHelp() {
57-
return "Generates PHP server stub using Zend Expressive ( https://zendframework.github.io/zend-expressive ) and Path Handler ( https://github.com/Articus/PathHandler ).";
57+
return "Generates PHP server stub using Mezzio ( https://docs.mezzio.dev/mezzio/ ) and Path Handler ( https://github.com/Articus/PathHandler ).";
5858
}
5959

60-
public PhpZendExpressivePathHandlerServerCodegen() {
60+
public PhpMezzioPathHandlerServerCodegen() {
6161
super();
6262

6363
modifyFeatureSet(features -> features
@@ -78,7 +78,7 @@ public PhpZendExpressivePathHandlerServerCodegen() {
7878
//no point to use double - http://php.net/manual/en/language.types.float.php , especially because of PHP 7+ float type declaration
7979
typeMapping.put("double", "float");
8080

81-
embeddedTemplateDir = templateDir = "php-ze-ph";
81+
embeddedTemplateDir = templateDir = "php-mezzio-ph";
8282
invokerPackage = "App";
8383
srcBasePath = "src" + File.separator + "App";
8484
apiDirName = "Handler";
@@ -101,13 +101,6 @@ public PhpZendExpressivePathHandlerServerCodegen() {
101101
supportingFiles.add(new SupportingFile("data_transfer.yml.mustache", "application" + File.separator + "config", "data_transfer.yml"));
102102
supportingFiles.add(new SupportingFile("Factory.php.mustache", srcBasePath, "Factory.php"));
103103
supportingFiles.add(new SupportingFile("InternalServerError.php.mustache", srcBasePath + File.separator + "Middleware", "InternalServerError.php"));
104-
supportingFiles.add(new SupportingFile("Date.php.mustache", srcBasePath + File.separator + "Strategy", "Date.php"));
105-
supportingFiles.add(new SupportingFile("DateTime.php.mustache", srcBasePath + File.separator + "Strategy", "DateTime.php"));
106-
supportingFiles.add(new SupportingFile("QueryParameter.php.mustache", srcBasePath + File.separator + "Strategy", "QueryParameter.php"));
107-
supportingFiles.add(new SupportingFile("QueryParameterArray.php.mustache", srcBasePath + File.separator + "Strategy", "QueryParameterArray.php"));
108-
supportingFiles.add(new SupportingFile("Type.php.mustache", srcBasePath + File.separator + "Validator", "Type.php"));
109-
supportingFiles.add(new SupportingFile("QueryParameterType.php.mustache", srcBasePath + File.separator + "Validator", "QueryParameterType.php"));
110-
supportingFiles.add(new SupportingFile("QueryParameterArrayType.php.mustache", srcBasePath + File.separator + "Validator", "QueryParameterArrayType.php"));
111104

112105
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, "1.0.0");
113106
}

modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ org.openapitools.codegen.languages.PhpSlimServerCodegen
8686
org.openapitools.codegen.languages.PhpSlim4ServerCodegen
8787
org.openapitools.codegen.languages.PhpSilexServerCodegen
8888
org.openapitools.codegen.languages.PhpSymfonyServerCodegen
89-
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
89+
org.openapitools.codegen.languages.PhpMezzioPathHandlerServerCodegen
9090
org.openapitools.codegen.languages.PowerShellClientCodegen
9191
org.openapitools.codegen.languages.ProtobufSchemaCodegen
9292
org.openapitools.codegen.languages.PythonLegacyClientCodegen

0 commit comments

Comments
 (0)