Note: Rephactor no longer uses sqlite since this was found to have limited subquery support (sqlite 2.8.16). Another issue is the difficulty debugging sql when errors are simply announced with no hint of why the query failed. A relational database is required by code analysis tools and so Rephactor now uses mysql(i).


Gentoo users should enable the mysqli & tokenizer USE flags for php in /etc/portage/package.use:


dev-lang/php mysqli tokenizer ..etc..


Other required extensions should be on by default. You can check with php -m.

Make sure you've emerged everything listed above.


$ sudo apt-get install php5-cli php5-mysql openssh-server subversion mysql-server

You might want to have a look at this ubuntu guide for configuring OpenSSH

Install Rephactor

The installer script will:

  1. install the following to a dir of your choice:
  2. add a "rephactor" alias to ~/.bashrc

  3. Add a public key (no passphrase) to ~/.ssh/authorized_keys. Some Rephactor tests interact with subversion fixtures and will repeatedly pester you for a password if they can't self-authenticate.

Download the installer script chmod +x and run.

Update the current terminal:

$ source ~/.bashrc

Now you can run rephactor:

$ rephactor help


Important: I advise running the Rephactor test suite before trying out a refactoring. It's a new app and hasn't been widely tested on different machines.

To run the Rephactor test suite (may take 10-15 minutes on a modest machine):

$ cd /your/path/to/rephactor
$ php test.php -tr lib/tests/

If any tests are failing I recommend that you do not try to use Rephactor. Please contact the support mailing list for help.

Next Step

Once Rephactor has been installed, you'll need to tell it about your working copies. See the User Guide for details. Logo