Renaming Files

This procedure describes how to rename files and update all instances where that file is referenced within the project.

Note:

Ensure that you save any changes to the file before applying the refactoring feature to it.

Instructions on how to complete a procedure

To rename a file using the Refactoring feature:

  1. In PHP Explorer view, right-click the file which you would like to rename and select Refactor | Rename -or- select it and go to Refactor | Rename from the Menu Bar.
    A Rename File dialog will appear.

Rename File dialog

  1. Enter the file's new name.

  2. Check the "Update references" box and click Preview.
    A preview window will open with a change tree showing all the changes which will be made to reflect the rename of the file, sorted according to the files in which the changes will be made.

Rename File change tree

Note that, if the file has been referenced (required, included etc.) in other files, the name of the file will also be updated in those instances.

  1. You can scroll through the different changes using the Select Next / Previous Change scrolling arrows .

  2. If you are satisfied with the changes, press OK.

The file will be renamed and all instances where that file is referenced will be updated to reflect the change.