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.
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.
eclipse helios for php developers
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.
Related
Does anyone use/have examples of using Phing from PHP? I'd quite like a web interface for Phing and am wondering how easily this could be achieved.
[Edit] In this specific instance we're deploying from Subversion using Phing.
Thanks,
Toby
There's no 'web interface' for Phing as such as far as I know. However you may be interested in using Jenkins/Hudson for what you're doing. You'll find that those two work together very well and when properly set up Jenkins will basically become your web interface to Phing.
See http://www.davegardner.me.uk/blog/2009/11/09/continuous-integration-for-php-using-hudson-and-phing/ and http://jenkins-ci.org/.
I am building a Flash, jQuery, and PHP based project which I would like to subversion from the get go. I have experience using Dreamweaver CS5's sub versioning capabilities. So, as far as the PHP and jQuery (the non-flash portion) goes, I'm pretty comfortable.
However, I would like some recommendations on how to subversion the Flash portion. I know Flash Builder has SVN capabilities, however, the flash portion isn't going to function as and RIA, but more, if you will, like a game. As far as my experience with Flash goes, this type of project will work best if done in Flash Professional. Here are the options, as I see them:
find an extension for Flash Professional which will enable SVN. Is there one???
create a "Flash Professional Project" in Flash Builder, built it in Flash Professional, and subversion with Flash Builder.
place my project within a defined site in Dreamweaver, and subversion from Dreamweaver.
I would like to avoid something like Tortoise SVN, as I have had more difficulty with that than I am up for for now. :)
Does anyone have any suggestions, or pointers as to how I can handle this?
Thank you for your time.
Well, any SVN client can handle any kind of file - you don't have to have an extension built into each piece of software you're using. The best way to do this is to put all of your project files into a folder somewhere and then using whatever SVN client you want just add that whole folder to your repo. Does that make sense? The front-end that you're using is more or less irrelevant.
I don't really understand what you are saying about TortoiseSVN, but since you are using different IDE's I would recommend you to use TortoiseSVN as the uniform interface to SVN. And IMO, TortoiseSVN is simple and powerful.
Man up and use the command line ;). Why SVN? Yes, I personally prefer it but there are other great alternatives, have a think about GIT, Mercurial and others too. Mercurial/Git have massive benefits for single developer projects. The flash file will be versioned just like everything else in there. Remember to set your ignore files appropriately to cut out all the os specific poop.
Soon as you get yourself a good versioning repository set up, it doesn't really matter what client you use. I like the one bundled with netbeans / versions or the cli.
We're about to look at implementing some PHP Coding Standards in our workplace to add some consistency between all of our developers.
I've read around and seen Zend and PEAR standards etc, but what's the best way to enforce these?
I've found a PHP Codesniffer plugin for netbeans, but are there any other ways I could enforce a standard, possibly CI (Continuous Integration) / Hudson or even when committing to SVN?
I was just wondering If anyone had experience or any other tools/methods I could look into?
Thanks
CodeSniffer is indeed the best tool for this.
There is a number of ways to use it:
integrating into Eclipse
integrate as pre-commit hook in you VCS
integrating into your CI Server
Disclaimer: the linked pages are just random picks from Google on that topic. They are not to suggest to use Eclipse, SVN or Hudson. Use what you think is appropriate for your development environment.
Also see http://www.qatools.org for additional tools.
I always wanted to perform code beautification on each SVN commit via SVN hooks.
Still belive it's the best & most efficient way.
Currently all team members just know that XXX is approved code beautifier and everyone supposed to use it.
At 2017 you have basically 3 options:
From oldest to newest (by features and codebase):
PHP_CodeSniffer
PHP CS Fixer
EasyCodingStandard - connects them both in super easy to understand way
does anyone know a package manager library for PHP (as e.g. apt or yum for linux distros) apart from PEAR? I'm working on a system which should include a package management system for module management. I managed to get a working solution using PEAR, but using the PEAR client for anything else than managing a PEAR installation is not really the optimal solution as it's not designed for that. I would have to modify/extend it (e.g. to implement actions on installation/upgrade or to move PEAR specific files like lockfiles away from the system root) and especially the CLI client code is quite messy and PHP4. So maybe someone has some suggestions
for an alternative PEAR client library which is easy to use and extend (the server side has some nice implementations like Pirum and pearhub)
for completely different package management systems written in PHP (ideally including dependency tracking and different channels)
for some general ideas how to implement such a PM system (yes, I'm still tinkering with the idea of implementing such a system from scratch)
I know that big systems like Magento and symfony use PEAR for their PM. Magento uses a hacked version of the original PEAR client (which I'd like to avoid), symfony's implementation seems quite integrated with the framework, but would be a good starting point to at least write the client from scratch. Anyway, if anybody has suggestions: please :)
There is Composer also.
Have you checked Maven for PHP? I've only used Maven in the context of Java applications, but it's certainly:
Easy to extend – it's really easy to implement Maven plugins
Manages dependencies – distinguishing compile, test and runtime dependencies (though the compile/runtime distintion doesn't make sense in PHP).
Repositories are trivial to put up – Apache with mod_dav will give you a working writable repository, but you also have Nexus.
Distinguishes snapshot from stable artifacts; allows several policies for when to check for new snapshot artifacts and from which repositories get each type.
And many – many – more things.
PEAR2/Pyrus was built for package management for arbitrary applications. I believe it was modeled after the apt/yum architectures.
Helgi - core PEAR member - covers some of it here - http://www.slideshare.net/helgith/pear2-pyrus-the-look-ahead but the documentation is pretty solid too: http://pear.php.net/manual/en/pyrus.extending.installation.php
this is a question on PHP mainly. I was wondering: How do you make sure that all necessary libaries are packaged with your application when you do a deployment to (production) servers?
A more concrete example: I have an app running on Zend Framework and each time I roll the application to a server the deployment process creates a fresh "installation" on that system. Therefore, I need to bundle Zend Framework together with my application and then copy the files to the right places together (it is done automatically). Currently, I am using a svn:externals definition to get the files out of Zend's SVN system during deployment, however, I don't want to rely on that SVN and I also don't want to put traffic on external SVNs with each deployment.
In the Java world, I am used to Maven which handles such stuff using central artifact repositries. I know that there is a Maven4PHP version, however, I am more looking for a PHP-based solution. Additionally, I don't believe that PEAR is a good way to go as it doesn't really fulfill my requirement of bundling the applicaiton (incl. libs) into a single deployable.
Is there some tool available already that I am not aware? Or do you have any great technique that I should know?
Thanks much for your help!
Michael
There's a build system called Phing which is written in PHP and based on Apache Ant.
I personally can very well live with externals.
I think the vendor branching would solve the problem from your example quite straightforward, but if you also don't like large repositories I'd recommended to keep watching on the modern toys like composer and what it solve(and maybe phark, I never heard before :) )
It isn't production ready yet but you might want to keep an eye on the Phark project. It is a port of Bundler to PHP.
While looking through the Simplify your external dependency management slides I came across a tool called pantr which can be used as a PEAR installer. pantr as PEAR installer which allows you to specify your dependencies in a project specific file.
The article Version Control != Dependency Management has some information about using the new PEAR installer called Pyrus