mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
doc/php: use buildComposerProject2
This commit is contained in:
parent
51b0d7832e
commit
4a0453277b
1 changed files with 4 additions and 4 deletions
|
@ -182,7 +182,7 @@ code, while others choose not to.
|
||||||
|
|
||||||
In Nix, there are multiple approaches to building a Composer-based project.
|
In Nix, there are multiple approaches to building a Composer-based project.
|
||||||
|
|
||||||
One such method is the `php.buildComposerProject` helper function, which serves
|
One such method is the `php.buildComposerProject2` helper function, which serves
|
||||||
as a wrapper around `mkDerivation`.
|
as a wrapper around `mkDerivation`.
|
||||||
|
|
||||||
Using this function, you can build a PHP project that includes both a
|
Using this function, you can build a PHP project that includes both a
|
||||||
|
@ -217,19 +217,19 @@ To customize the PHP version, you can specify the `php` attribute. Similarly, if
|
||||||
you wish to modify the Composer version, use the `composer` attribute. It is
|
you wish to modify the Composer version, use the `composer` attribute. It is
|
||||||
important to note that both attributes should be of the `derivation` type.
|
important to note that both attributes should be of the `derivation` type.
|
||||||
|
|
||||||
Here's an example of working code example using `php.buildComposerProject`:
|
Here's an example of working code example using `php.buildComposerProject2`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ php, fetchFromGitHub }:
|
{ php, fetchFromGitHub }:
|
||||||
|
|
||||||
php.buildComposerProject (finalAttrs: {
|
php.buildComposerProject2 (finalAttrs: {
|
||||||
pname = "php-app";
|
pname = "php-app";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "git-owner";
|
owner = "git-owner";
|
||||||
repo = "git-repo";
|
repo = "git-repo";
|
||||||
rev = finalAttrs.version;
|
tag = finalAttrs.version;
|
||||||
hash = "sha256-VcQRSss2dssfkJ+iUb5qT+FJ10GHiFDzySigcmuVI+8=";
|
hash = "sha256-VcQRSss2dssfkJ+iUb5qT+FJ10GHiFDzySigcmuVI+8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue