Skip to content

Commit 939ae6f

Browse files
authored
feat(librarian/internal/config): add php config (#6701)
Add initial set of config for PHP. For #6629
1 parent b439528 commit 939ae6f

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

doc/config-schema.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ This document describes the schema for the librarian.yaml.
135135
| `go` | [GoModule](#gomodule-configuration) (optional) | Contains Go-specific library configuration. |
136136
| `java` | [JavaModule](#javamodule-configuration) (optional) | Contains Java-specific library configuration. |
137137
| `nodejs` | [NodejsPackage](#nodejspackage-configuration) (optional) | Contains Node.js-specific library configuration. |
138+
| `php` | [PHPPackage](#phppackage-configuration) (optional) | Contains PHP-specific library configuration. |
138139
| `python` | [PythonPackage](#pythonpackage-configuration) (optional) | Contains Python-specific library configuration. |
139140
| `rust` | [RustCrate](#rustcrate-configuration) (optional) | Contains Rust-specific library configuration. |
140141
| `swift` | [SwiftPackage](#swiftpackage-configuration) (optional) | Contains Swift-specific library configuration. |
@@ -190,6 +191,7 @@ This document describes the schema for the librarian.yaml.
190191
| `go` | [GoAPI](#goapi-configuration) (optional) | Contains Go-specific API configuration. |
191192
| `java` | [JavaAPI](#javaapi-configuration) (optional) | Contains Java-specific API configuration. |
192193
| `nodejs` | [NodejsAPI](#nodejsapi-configuration) (optional) | Contains Node.js-specific API configuration. |
194+
| `php` | [PHPAPI](#phpapi-configuration) (optional) | Contains PHP-specific API configuration. |
193195

194196
## GoDefault Configuration
195197

@@ -418,6 +420,17 @@ This document describes the schema for the librarian.yaml.
418420
| `metadata_name_override` | string | Allows the name field in .repo-metadata.json to be overridden. |
419421
| `name_pretty_override` | string | Allows the name_pretty field in .repo-metadata.json to be overridden. |
420422

423+
## PHPAPI Configuration
424+
425+
| Field | Type | Description |
426+
| :--- | :--- | :--- |
427+
| `migration_mode` | string | Controls migration mode setting for the PHP generator (e.g. "NEW_SURFACE_ONLY"). |
428+
429+
## PHPPackage Configuration
430+
431+
| Field | Type | Description |
432+
| :--- | :--- | :--- |
433+
421434
## PythonDefault Configuration
422435

423436
| Field | Type | Description |

internal/config/config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ type Library struct {
330330
// Nodejs contains Node.js-specific library configuration.
331331
Nodejs *NodejsPackage `yaml:"nodejs,omitempty"`
332332

333+
// PHP contains PHP-specific library configuration.
334+
PHP *PHPPackage `yaml:"php,omitempty"`
335+
333336
// Python contains Python-specific library configuration.
334337
Python *PythonPackage `yaml:"python,omitempty"`
335338

@@ -423,6 +426,9 @@ type API struct {
423426

424427
// Nodejs contains Node.js-specific API configuration.
425428
Nodejs *NodejsAPI `yaml:"nodejs,omitempty"`
429+
430+
// PHP contains PHP-specific API configuration.
431+
PHP *PHPAPI `yaml:"php,omitempty"`
426432
}
427433

428434
// GoDefault defines Go-specific default configuration.

internal/config/language.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,3 +804,13 @@ type NodejsAPI struct {
804804
// Path is the source path.
805805
Path string `yaml:"path,omitempty"`
806806
}
807+
808+
// PHPPackage contains PHP-specific library configuration.
809+
type PHPPackage struct {
810+
}
811+
812+
// PHPAPI represents configuration for a single API within a PHP package.
813+
type PHPAPI struct {
814+
// MigrationMode controls migration mode setting for the PHP generator (e.g. "NEW_SURFACE_ONLY").
815+
MigrationMode string `yaml:"migration_mode,omitempty"`
816+
}

0 commit comments

Comments
 (0)