A command-line refactoring tool for php5.
If code was just about making computers do stuff naming wouldn't matter. Machines don't really care what you call something — but people do. Good names make code much easier to understand. Bad ones take precious minutes out of your working day while you pause to figure out if class: "Auth" is something to do with authentication or authorisation? Maybe it's both?
Names often have to be changed, particularly in the early stages of a project. Concepts are refined as you learn about a new domain; vague ideas come into sharper focus.
How to change them? Renaming a class requires an edit to every file which creates an instance. Renaming a file requires that each reference to the original path be updated. Although text editor functions "find in files" and "find replace" do help, it can still be a chore to hunt them all down manually. It gets even harder if a core library is used by many client apps and affected files are spread across several different projects. If it's open source code, there could be a large user base to consider. One small change can start a whole avalanche of trouble.
This is the kind of problem which Rephactor is intended to solve. An automated tool can provide an easy way to make changes which impact multiple files.
Currently Rephactor can only be used with code which is under Subversion version control. It's primarily aimed at php v5. Although some refactorings — find-replace and preg-replace — will work on any version of php (indeed on any kind of text file) others will not update older v4 code correctly.
*Rephactor will update client apps at the same time as the "primary target" if they are on the local machine. If not, Rephactor scripts can be distributed to end users and then users can update projects built on top of the changed library. This can help free authors to make changes without having to worry about deprecation cycles.
The Rephactor user guide, including installation instructions, can be found here.
You can get in touch via the Rephactor mailing list. My name is Noel Darlow. You might have met me online under the name mcgruff.
A big thank you to the developers of Phemto and SimpleTest, both used in Rephactor. Also the project host sourceforge.