madk Posted March 13, 2009 Share Posted March 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/149249-rename-all-function-references/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 13, 2009 Share Posted March 13, 2009 A lot of programming editors, like notepad++, have a search/replace function that operates on all files within a selected folder. Quote Link to comment https://forums.phpfreaks.com/topic/149249-rename-all-function-references/#findComment-783753 Share on other sites More sharing options...
Maq Posted March 13, 2009 Share Posted March 13, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/149249-rename-all-function-references/#findComment-783755 Share on other sites More sharing options...
madk Posted March 13, 2009 Author Share Posted March 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/149249-rename-all-function-references/#findComment-783779 Share on other sites More sharing options...
MiCR0 Posted March 13, 2009 Share Posted March 13, 2009 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 ! Quote Link to comment https://forums.phpfreaks.com/topic/149249-rename-all-function-references/#findComment-783789 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.