From 433d1889b7121589bb943f2f83bb499e47e73608 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Wed, 8 Jul 2026 11:29:00 -0400 Subject: [PATCH 1/3] feat(librarian/internal/config): add php config --- doc/config-schema.md | 15 +++++++++++++++ internal/config/config.go | 6 ++++++ internal/config/language.go | 15 +++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/doc/config-schema.md b/doc/config-schema.md index b82b6d6cdff..5712fca67d3 100644 --- a/doc/config-schema.md +++ b/doc/config-schema.md @@ -135,6 +135,7 @@ This document describes the schema for the librarian.yaml. | `go` | [GoModule](#gomodule-configuration) (optional) | Contains Go-specific library configuration. | | `java` | [JavaModule](#javamodule-configuration) (optional) | Contains Java-specific library configuration. | | `nodejs` | [NodejsPackage](#nodejspackage-configuration) (optional) | Contains Node.js-specific library configuration. | +| `php` | [PHPPackage](#phppackage-configuration) (optional) | Contains PHP-specific library configuration. | | `python` | [PythonPackage](#pythonpackage-configuration) (optional) | Contains Python-specific library configuration. | | `rust` | [RustCrate](#rustcrate-configuration) (optional) | Contains Rust-specific library configuration. | | `swift` | [SwiftPackage](#swiftpackage-configuration) (optional) | Contains Swift-specific library configuration. | @@ -190,6 +191,7 @@ This document describes the schema for the librarian.yaml. | `go` | [GoAPI](#goapi-configuration) (optional) | Contains Go-specific API configuration. | | `java` | [JavaAPI](#javaapi-configuration) (optional) | Contains Java-specific API configuration. | | `nodejs` | [NodejsAPI](#nodejsapi-configuration) (optional) | Contains Node.js-specific API configuration. | +| `php` | [PHPAPI](#phpapi-configuration) (optional) | Contains PHP-specific API configuration. | ## GoDefault Configuration @@ -418,6 +420,19 @@ This document describes the schema for the librarian.yaml. | `metadata_name_override` | string | Allows the name field in .repo-metadata.json to be overridden. | | `name_pretty_override` | string | Allows the name_pretty field in .repo-metadata.json to be overridden. | +## PHPAPI Configuration + +| Field | Type | Description | +| :--- | :--- | :--- | +| `path` | string | Is the source path. | +| `migration_mode` | string | Controls migration mode setting for the PHP generator (e.g. "NEW_SURFACE_ONLY"). | + +## PHPPackage Configuration + +| Field | Type | Description | +| :--- | :--- | :--- | +| `php_apis` | list of [PHPAPI](#phpapi-configuration) (optional) | Is a list of PHP-specific API configurations. | + ## PythonDefault Configuration | Field | Type | Description | diff --git a/internal/config/config.go b/internal/config/config.go index 939084ba1ac..bc9f4b1d84e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -330,6 +330,9 @@ type Library struct { // Nodejs contains Node.js-specific library configuration. Nodejs *NodejsPackage `yaml:"nodejs,omitempty"` + // Php contains PHP-specific library configuration. + Php *PHPPackage `yaml:"php,omitempty"` + // Python contains Python-specific library configuration. Python *PythonPackage `yaml:"python,omitempty"` @@ -423,6 +426,9 @@ type API struct { // Nodejs contains Node.js-specific API configuration. Nodejs *NodejsAPI `yaml:"nodejs,omitempty"` + + // Php contains PHP-specific API configuration. + Php *PHPAPI `yaml:"php,omitempty"` } // GoDefault defines Go-specific default configuration. diff --git a/internal/config/language.go b/internal/config/language.go index e394198f047..d9b24e01df5 100644 --- a/internal/config/language.go +++ b/internal/config/language.go @@ -804,3 +804,18 @@ type NodejsAPI struct { // Path is the source path. Path string `yaml:"path,omitempty"` } + +// PHPPackage contains PHP-specific library configuration. +type PHPPackage struct { + // PHPAPIs is a list of PHP-specific API configurations. + PHPAPIs []*PHPAPI `yaml:"php_apis,omitempty"` +} + +// PHPAPI represents configuration for a single API within a PHP package. +type PHPAPI struct { + // Path is the source path. + Path string `yaml:"path,omitempty"` + + // MigrationMode controls migration mode setting for the PHP generator (e.g. "NEW_SURFACE_ONLY"). + MigrationMode string `yaml:"migration_mode,omitempty"` +} From bab39460f02d7b0a4f824707e0024f5bfb034411 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Wed, 8 Jul 2026 11:37:29 -0400 Subject: [PATCH 2/3] update name case per convention --- internal/config/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index bc9f4b1d84e..3038dcc9cdf 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -330,8 +330,8 @@ type Library struct { // Nodejs contains Node.js-specific library configuration. Nodejs *NodejsPackage `yaml:"nodejs,omitempty"` - // Php contains PHP-specific library configuration. - Php *PHPPackage `yaml:"php,omitempty"` + // PHP contains PHP-specific library configuration. + PHP *PHPPackage `yaml:"php,omitempty"` // Python contains Python-specific library configuration. Python *PythonPackage `yaml:"python,omitempty"` @@ -427,8 +427,8 @@ type API struct { // Nodejs contains Node.js-specific API configuration. Nodejs *NodejsAPI `yaml:"nodejs,omitempty"` - // Php contains PHP-specific API configuration. - Php *PHPAPI `yaml:"php,omitempty"` + // PHP contains PHP-specific API configuration. + PHP *PHPAPI `yaml:"php,omitempty"` } // GoDefault defines Go-specific default configuration. From 90be46b67b90dc037b96b143331731f4cd8868de Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Wed, 8 Jul 2026 12:01:44 -0400 Subject: [PATCH 3/3] rm redandunt config for PHPAPI --- doc/config-schema.md | 2 -- internal/config/language.go | 5 ----- 2 files changed, 7 deletions(-) diff --git a/doc/config-schema.md b/doc/config-schema.md index 5712fca67d3..e23892bf1eb 100644 --- a/doc/config-schema.md +++ b/doc/config-schema.md @@ -424,14 +424,12 @@ This document describes the schema for the librarian.yaml. | Field | Type | Description | | :--- | :--- | :--- | -| `path` | string | Is the source path. | | `migration_mode` | string | Controls migration mode setting for the PHP generator (e.g. "NEW_SURFACE_ONLY"). | ## PHPPackage Configuration | Field | Type | Description | | :--- | :--- | :--- | -| `php_apis` | list of [PHPAPI](#phpapi-configuration) (optional) | Is a list of PHP-specific API configurations. | ## PythonDefault Configuration diff --git a/internal/config/language.go b/internal/config/language.go index d9b24e01df5..d9e3fb05711 100644 --- a/internal/config/language.go +++ b/internal/config/language.go @@ -807,15 +807,10 @@ type NodejsAPI struct { // PHPPackage contains PHP-specific library configuration. type PHPPackage struct { - // PHPAPIs is a list of PHP-specific API configurations. - PHPAPIs []*PHPAPI `yaml:"php_apis,omitempty"` } // PHPAPI represents configuration for a single API within a PHP package. type PHPAPI struct { - // Path is the source path. - Path string `yaml:"path,omitempty"` - // MigrationMode controls migration mode setting for the PHP generator (e.g. "NEW_SURFACE_ONLY"). MigrationMode string `yaml:"migration_mode,omitempty"` }