Skip to content
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

Progress thread: PHP #240

Open
aszenz opened this issue Aug 10, 2022 · 8 comments
Open

Progress thread: PHP #240

aszenz opened this issue Aug 10, 2022 · 8 comments

Comments

@aszenz
Copy link
Contributor

aszenz commented Aug 10, 2022

PHP has standardized on composer as it's package manager, would be great to support it here.

@raboof
Copy link
Contributor

raboof commented Aug 17, 2022

It would be useful to have a composer translator and php builder, perhaps taking inspiration from https://github.com/svanderburg/composer2nix

I see the composer.lock file format does have a shasum field, but it seems to be left empty for the composer.lock files that I've seen so far, not sure what's going on there. Some more discussion on the hash input at composer/composer#2540 .

@wmertens
Copy link
Contributor

I sometimes have to touch PHP and I see that there's often a composer dump-autoload step that seems to add extra php files.

Also, some PHP modules seem to use relative imports to get configuration from the main project, or is that rare? So if the vendor dir were a symlink to the nix store, those modules wouldn't work.

Basically, I'm wondering how the vendor dir would best be built.

@aszenz
Copy link
Contributor Author

aszenz commented Aug 21, 2022

Some frameworks also have composer plugins which add their own php files.

Case in point Symfony flex

@wmertens
Copy link
Contributor

So, two modes, one just symlinks a vendor dir (when all components behave), and the other mode copies the entire thing?

@aszenz
Copy link
Contributor Author

aszenz commented Aug 31, 2022

It would be cool if we test this packaging solution against demo repos of popular frameworks like symfony demo:

https://github.com/symfony/demo

Having demo apps working out of the box would be a great DX for nix usage in php ecosystem

@aszenz
Copy link
Contributor Author

aszenz commented Aug 31, 2022

It is also a good way to document how to build php apps which depend on nodejs/webpack for their front-end using dream2nix since it supports building packages for multiple ecosystems.

@DavHau
Copy link
Member

DavHau commented Aug 31, 2022

It would be cool if we test this packaging solution against demo repos of popular frameworks like symfony demo:

See dream2nix indexers feature: https://nix-community.github.io/dream2nix/intro/indexers.html
Example under: /examples/_d2n-indexer

We could implement a PHP indexer to produce a list of the X most well known php github projects etc. Alternatively there already exists an ecosystem agnostic indexer libraries-io which queries libraries.io.

Apart from that all subsystems in dream2nix should provide a usage example under /example. So we could put the first example there.

@tinybeachthor
Copy link
Contributor

tinybeachthor commented Sep 26, 2022

  • add meta to packages
  • php versions
  • override package version
    • usually packages don't have version field in composer.json resulting in package names like name-unknown
    • add a subsystem attribute to allow setting the version field
    • this will also come handy in the packagist translator
  • indexer -> nix-community
  • package overrides
    • there are still packages that don't translate or build because of minor issues
    • bug hunting and adding overrides
  • php + nodejs integration
    • many repos use php & nodejs
    • add an example of build
    • verify that nameclashes don't cause issues
    • add to docs?
  • php subsystem docs - remove experimental notice

@DavHau DavHau changed the title Language request: PHP Progress thread: PHP Nov 9, 2022
@DavHau DavHau added the php label Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants