Find & replace in a php file???
I feel really stupid for asking this, but how do you perform search and replace in a normal php file - no classes - just few functions?
Like this:
function com_install() {
jimport('joomla.filesystem');
$update = checkIfUpdating();
switch($update) {
case '1b':
dropToolbars();
updateFiles();
updateSettings1b();
case '1b2':
updateFilesBeta2();
case '1stable':
updateFiles1stable();
updateSettings1stable();
case '2.0':
case '2.0.1':
case '2.0.2':
case '2.0.3':
case '2.0.4':
updateSettings204();
case '2.0.5':
updateDatabaseStructure205();
break;
case 'new':
insertNewSettings();
break;
}
if ($update != 'new') {
updateVersionNumber();
}
installPlugins();
}
I have selected jimport and clicked on ctrl+R and i get cannot perform refactoring - selected function is not located inside this project. I don't want to refactor -> I just want to rename the function in that particular file?
I can select the directory and use the option "replace in path" -> it will find the text that I search for and I can replace from there, but this seems really overly complicated just for few changes in a file???
Am I missing something?
请先登录再写评论。
Hi Daniel,
Please check your shortcuts (Settings | Keymap -- maybe choose another scheme or customize yourself) as it seems that your keymap is quite different from what you are expected.
The Replace command you are after -- Main Menu | Edit | Find | Replace -- check what shortcut you do have there. Make sure that editor window is active in order to activate this command.
Hey Andriy,
Thank you very much! I was looking all the time in the edit menu for replace -> didn't expect that under find I'll have the replace.
You have no idea how frustrated I was with that all the time...
That was it my shortcut was actually diffirent!
Thank you and have a nice day!
Daniel