Skip to content
This repository has been archived by the owner on Feb 11, 2019. It is now read-only.

Requirements #21

Open
jwoodcock opened this issue Mar 18, 2014 · 4 comments
Open

Requirements #21

jwoodcock opened this issue Mar 18, 2014 · 4 comments

Comments

@jwoodcock
Copy link
Member

I wanted to open a discussion around how to keep track of requirements and installing those requirements from environment to environment.

Part of the workflow in virtualenv, you define your requirements typically in a requirements.txt file which allows one-time install per-environment.

I'm proposing we do something similar, where we build a couple of new commands:

  1. Install
    This command would simply run the install of the environment dependencies; pecl, pear and potentially a composer global install (this latter needs more conversation).
php virtphp.phar install
  1. add-requirement
    This command will update the requirement file with the new requirement and also have a couple of options.
php virtphp.phar add-requirement --name={name of dependency} --version={version number if needing specific} --service={service such as pear or pecl}

All this information will be stored in a new requirements.json file kept in each virtPHP environment.

@jakerella
Copy link
Member

Is the idea that we would have a list of implemented "services" that the requirements fall into? ("pear", "pecl", etc)? If we just use the underlying CLI commands would recursive dependencies be handled automatically?

@jwoodcock
Copy link
Member Author

Yes, the idea is that we run the CLI commands to install these requirements.

@philsturgeon
Copy link
Contributor

Yep, I'd agree that this is needed.

Right now, Dev A knows what has been installed and can make some sort of list of requirements for Dev B to run when they want to get started. That could probably be a README or a bash file, but it could also be something a bit more awesome.

That said, with composer getting close to supporting extensions via pickle, I wonder how required it will be. I'd like to just pretend PEAR doesn't exist.

@ramsey
Copy link
Contributor

ramsey commented Oct 1, 2014

I have some uncommitted work that implements some of what I wanted to see done here. Essentially, the idea is to have a "freeze" command (much like pip freeze) that will serialize all the requirements to a single JSON file that may be added to a project's repository (similar to pip's requirements.txt). This would include the PHP version, all PHP extensions built into PHP, all PECL extensions installed and their versions, all PEAR packages and their versions, and all "global" Composer packages and their versions.

When creating a virtPHP environment, one could use the requirements JSON file to set up everything. Of course, this means we'd probably need to standardize on a PHP build tool like phpbrew and provide a wrapper around that tool to install the correct version of PHP with all the specified built-in extensions.

I think a .php-version file is more in keeping with something that a project like phpbrew would need to manage, but that doesn't mean we can't contribute that to phpbrew and use it from virtPHP.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants