Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2022 19:31:37 -0700
From:      Mel Pilgrim <list_freebsd@bluerosetech.com>
To:        freebsd-ports@freebsd.org
Subject:   How to port a PHP application that uses Composer?
Message-ID:  <130ec10a-219a-ac8b-06d9-80d31261dd39@bluerosetech.com>

next in thread | raw e-mail | index | archive | help
Composer is a github-centric dependency management tool for PHP 
applications.  It works very well on its own, but I'm having trouble 
figuring out how to integrate it with pkg building.

The composer workflow is:

1. Clone the PHP application repo, which has a composer.json file
2. Download composer.phar and run `php composer.phar ...`
3. Composer examines composer.json and downloads dependencies from other 
github repos
4. Composer creates an autoloader script that does all of the require 
calls for the dependencies

The problem is that download and autoloader script part.  If I ran it as 
part of the pkg building process, there's a fetch-extract race as it 
needs network access, but also a file extracted from the distfile.

If I left it to user config, the autoloader script creation will change 
a file managed by pkg.

So how do I do this? Can a composer-using PHP application be ported?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?130ec10a-219a-ac8b-06d9-80d31261dd39>