I normally work on Python projects and we have a good tool called virtualenv for setting up project environments. Does something similar exist for PHP? I have not been able to find one.
Not quite what I'm talking about here. I use emacs anyway :)
dcolish
2010-07-09 13:59:28
A:
As far as I know there isn't really a way of doing this in PHP without having to install loads of tools. My best guess would be to set up a VCS, such as Git, and use branches to mimic environments. It's ugly, but it works.
Yorick Peterse
2010-07-09 14:25:08
+1
A:
Hmm, maybe PEAR does what you want. PEAR is a repository of various useful classes. You can download them, but you also use the Command Line to manage packages. Apart from this, there is nothing I know that would do this. There is phing to automate build processes. It's like Java's Ant. And some frameworks have RAD tools to setup projects, but those are usually aimed at the framework specific parts.
Gordon
2010-07-09 14:35:12
Yeah, I have been looking at PEAR but its not 100% clear to me how I can have a per project include path. I'll look into that some more. I certainly think the tool I'm looking for should use PEAR.
dcolish
2010-07-09 14:44:14
@dcolish you can set the [include path at runtime](http://de2.php.net/manual/en/function.set-include-path.php) or do you mean you want have all the libs you download from PEAR for the application in the application folder?
Gordon
2010-07-09 14:53:42
I meant the latter. I'd like to have the project specific libs be part of the project only. I do not want to have them available system wide. This way I can possibly pin versions of libs based on a projects needs.
dcolish
2010-07-09 15:02:13
@dcolish I am not sure the pear manager can install in specific directories. You might have more luck with Phing then. Or maybe Zend_Tool from the Zend Framework. That's an extensible command line tool.
Gordon
2010-07-09 15:24:49
@Gordon I did some more digging and I think PEAR/Pyrus will do exactly what I need. I can set the include_path in a variety of config files specifically for that project. I don't think it will be hard to script this out.
dcolish
2010-07-09 16:13:46