Jump to content

Rename all function references


madk

Recommended Posts

Hello,

 

I'm got a client running some code that contains a function called date_format. We are porting over to PHP 5 and now PHP5 has it's own date_format function.  I am looking for a script that will parse all php files and rename any references to the function call.

 

Just wondering if anyone has an code I could look at so I don't recreate the wheel.

 

Thanks in advance.

Link to comment
Share on other sites

Are the changes going to be made on linux or windows?

 

With Linux you can just use the "sed" command.  Works great with regular expressions.

 

With windows there are find/replace programs that may be suitable.  Or you can use Cygwin, which should support the "sed" command.

 

Good luck!

Link to comment
Share on other sites

Are the changes going to be made on linux or windows?

 

With Linux you can just use the "sed" command.  Works great with regular expressions.

 

With windows there are find/replace programs that may be suitable.  Or you can use Cygwin, which should support the "sed" command.

 

Good luck!

 

It'll be on Linux but I have to deploy it across about 15 sites on separate servers, which is why I'm looking for a script that I can just call easily. I'll look into the sed command.

Link to comment
Share on other sites

I have to do that sort of stuff every time when take over a new site so I know what a pain it is but Notepad++ can hold open a good 500 pages throw wine at the same time and open 50 pages at once at the same time use that and then replace all on open doc's job done !

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.