-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow extensions to override download URLs #187
base: main
Are you sure you want to change the base?
Changes from 11 commits
9f93273
a6fad77
933b994
edf17f5
f515b73
702b71d
f0c5b66
2d4779f
7f93eb3
504aa88
36da7b2
30714fe
9f5e15a
70639a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,6 +160,26 @@ should specify this path in `build-path`, for example: | |
} | ||
``` | ||
|
||
The `build-path` may contain some templated values which are replaced: | ||
|
||
* `{version}` to be replaced with the package version. For example a package | ||
with version 1.2.3 with a `build-path` of `myext-{version}` the actual build | ||
path would become `myext-1.2.3`. | ||
Comment on lines
+163
to
+167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The For the mongodb extension, the build-path is at the root of the Git repository, so this setting seems incompatible with installation from Git clone. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea! Leave it with me and I'll see what we can do, thank you |
||
|
||
#### `download-url-method` | ||
|
||
The `download-url-method` directive allows extension maintainers to | ||
change the behaviour of downloading the source package. | ||
|
||
* Setting this to `composer-default`, which is the default value if not | ||
specified, will use the default behaviour implemented by Composer, which is | ||
to use the standard ZIP archive from the GitHub API (or other source control | ||
system). | ||
* Using `pre-packaged-source` will locate a source code package in the release | ||
assets list based matching one of the following naming conventions: | ||
* `php_{ExtensionName}-{Version}-src.tgz` (e.g. `php_myext-1.20.1-src.tgz`) | ||
* `php_{ExtensionName}-{Version}-src.zip` (e.g. `php_myext-1.20.1-src.zip`) | ||
|
||
### Extension dependencies | ||
|
||
Extension authors may define some dependencies in `require`, but practically, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://raw.githubusercontent.com/php/pie/main/composer-json-php-ext-schema.json", | ||
"title": "composer.json php-ext schema", | ||
"description": "Schema for the proposed php-ext section in composer.json that the new PECL will use to build packages", | ||
"type": "object", | ||
"properties": { | ||
"php-ext": { | ||
"type": "object", | ||
"description": "Settings for PHP extension packages.", | ||
"properties": { | ||
"extension-name": { | ||
"type": "string", | ||
"description": "If specified, this will be used as the name of the extension, where needed by tooling. If this is not specified, the extension name will be derived from the Composer package name (e.g. `vendor/name` would become `ext-name`). The extension name may be specified with or without the `ext-` prefix, and tools that use this must normalise this appropriately.", | ||
"example": "ext-xdebug" | ||
}, | ||
"priority": { | ||
"type": "integer", | ||
"description": "This is used to add a prefix to the INI file, e.g. `90-xdebug.ini` which affects the loading order. The priority is a number in the range 10-99 inclusive, with 10 being the highest priority (i.e. will be processed first), and 99 being the lowest priority (i.e. will be processed last). There are two digits so that the files sort correctly on any platform, whether the sorting is natural or not.", | ||
"minimum": 10, | ||
"maximum": 99, | ||
"example": 80, | ||
"default": 80 | ||
}, | ||
"support-zts": { | ||
"type": "boolean", | ||
"description": "Does this package support Zend Thread Safety", | ||
"example": false, | ||
"default": true | ||
}, | ||
"support-nts": { | ||
"type": "boolean", | ||
"description": "Does this package support non-Thread Safe mode", | ||
"example": false, | ||
"default": true | ||
}, | ||
"build-path": { | ||
"type": ["string", "null"], | ||
"description": "If specified, this is the subdirectory that will be used to build the extension instead of the root of the project.", | ||
"example": "my-extension-source", | ||
"default": null | ||
}, | ||
"download-url-method": { | ||
"type": "string", | ||
"description": "If specified, this technique will be used to override the URL that PIE uses to download the asset. The default, if not specified, is composer-default.", | ||
"enum": ["composer-default", "pre-packaged-source"], | ||
"example": "composer-default" | ||
}, | ||
"os-families": { | ||
"type": "array", | ||
"minItems": 1, | ||
"description": "An array of OS families to mark as compatible with the extension. Specifying this property will mean this package is not installable with PIE on any OS family not listed here. Must not be specified alongside os-families-exclude.", | ||
"items": { | ||
"type": "string", | ||
"enum": ["windows", "bsd", "darwin", "solaris", "linux", "unknown"], | ||
"description": "The name of the OS family to mark as compatible." | ||
} | ||
}, | ||
"os-families-exclude": { | ||
"type": "array", | ||
"minItems": 1, | ||
"description": "An array of OS families to mark as incompatible with the extension. Specifying this property will mean this package is installable on any OS family except those listed here. Must not be specified alongside os-families.", | ||
"items": { | ||
"type": "string", | ||
"enum": ["windows", "bsd", "darwin", "solaris", "linux", "unknown"], | ||
"description": "The name of the OS family to exclude." | ||
} | ||
}, | ||
"configure-options": { | ||
"type": "array", | ||
"description": "These configure options make up the flags that can be passed to ./configure when installing the extension.", | ||
"items": { | ||
"type": "object", | ||
"required": ["name"], | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "The name of the flag, this would typically be prefixed with `--`, for example, the value 'the-flag' would be passed as `./configure --the-flag`.", | ||
"example": "without-xdebug-compression", | ||
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" | ||
}, | ||
"needs-value": { | ||
"type": "boolean", | ||
"description": "If this is set to true, the flag needs a value (e.g. --with-somelib=<path>), otherwise it is a flag without a value (e.g. --enable-some-feature).", | ||
"example": false, | ||
"default": false | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "The description of what the flag does or means.", | ||
"example": "Disable compression through zlib" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"not": { | ||
"required": ["os-families", "os-families-exclude"] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably pin to the next stable Composer release, when that happens 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using
^2.9.0@dev
instead as constraint here. It will be more explicit about the intentThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^2.8.6@dev