Basic PHP Storm Questions

Just testing out phpstorm and getting started.

  1. Under Settings>PPHP. What goes into the "include path" part and why would I want to use it? The Help didn't really tell me much about what actually goes here.
  2. What are smart tabs? I couldn't understand from this: http://www.jetbrains.com/phpstorm/webhelp/general.html. Can someone explain why this would be useful?
  3. What is a "continuation indent" ?
  4. What are the files placed under .idea in a new project for?
  5. Can I disable the browser bar, or better, put it somewhere else, like on the toolbar? (The popup that lets you  test your code in different browsers.)
  6. Can I select an entire line of code through any sort of shortcut? for example, in Microsoft Word, you can select a line by hovering near the
    left hand side - the mouse pointer will turn to the right, instead of the normal left, indicating tha ingle click will select the entire line. This is pretty normal behavior in a lot of Windows
    programs. Can something similar be done here?
  7. Is a birds eye view of the code possible, like (I think it is) in sublime text? (Never used it, just read about it and saw some screenshots.) I want a little "minimap" of the code.
  8. Can PHP storm tell me what the content of built in functions ought to be? it does it initially, but not while I am actually writing the function.
    Dreamweaver provided some hints as to what a function arguments were - example, $needle, $haystack, etc. these came more or less from
    the php documentation, I believe.
  9. Is there a way to have the elements of built in functions, like filter_var's fitlers available, or $_SERVER['(options)']?
  10. As an addition to (9), in dreamweaver I could type $_SER and $_SERVER would be available for autocomplete. Upon selecting it, I got $_SERVER[, so all I had to do was type ' and then autocomplete suggested everything that go into $_SERVER[' ']. Can any or all of this be done in phpstorm?
  11. After creating a toolbar button for a comand that doesnt have an icon (it was for "New"), and after I removed the icon from the toolbar, the icon remains by "New" in the File Menu. Can this icon be removed?
  12. Is it possible to add a button to the toolbar that opens a specific type of new document (php file, php class, or html file)? Is there also a keyboard command to do this? Right now it takes at least 2 clicks and some mouse movement between clicks to navigate tot he type of file you want to create.
  13. What does the caret refer to? When I think of a caret, I think of this "^". By caret, does the documentaion mean the mouse cursor or mouse pointer?
  14. Is it possible to just get a variable name only with a double click? Instead of getting "$helloworld" I just get "helloworld." This helps with changing variable names in single instances.


Thanks for all help.

11 comments
Comment actions Permalink

Hi there.

1) This is to include your additional libraries/code that is not part of your actual project so that IDE can still index it and provide help with code completion/analysis when such code will be used in your project (e.g. PHPUnit, Phing etc). Somehow similar to what php.ini's include_path does.

IDE will not include TODO's from those files, will not run inspections on that code, will not include it in Find/Replace/Refactor etc -- it is for reference only.

2) http://www.jetbrains.com/phpstorm/webhelp/code-style-php.html -- explained with pictures

3) Hard to explain. I always having it the same as normal indent. Better see how it works on Code Style settings for JavaScript -- if you change it from 4 to 8 (or another value) the code example will be reformatted to reflect those changes.

4) Your project configuration/project settings.

5) No and No. But you can disable all browsers via "Settings | Browsers" and that bar will not really be shown.


6) Single click on line number (in the editor gutter) or you can assign any shortcut to "Select Line" action in "Settings | Keymap" (in has search functionality, so it will be not too hard to find it).

7) No. But there is one plugin for that (find it in "Settings | Plugins | Browse Repositories...")

8) "...what the content of built in functions ought to be?" -- WTF is that?

I guess you mean list of parameters. If so -- "View | Parameter Info (Ctrl+P)" (must be invoked when caret is inside function call brackets).

If you need a better help on that function (what function does and what each parameter is about) -- "View | Quick Documentation (Ctrl+Q)" (must be invoked when caret is standing on actual function/variable/class/etc)

9) $_SERVER['(options)'] is supported already. Just invoke code completion manually (see #10). Functions are not. But you can try "PHP Advanced AutoComplete" plugin -- it has support for quite a few standard functions.

10) Works fine in PhpStrm as well. Ctrl+Space (or whatever you may have there for "Code | Completion | Basic") to manually invoke code completion popup in case you have disabled automatic popup (which is quite annoying for some people).

11) Show a screenshot please -- I do not know what issue you are having there (never created custom tooolbar buttons myself -- no need for it). But I think restarting IDE may help. If not -- "Settings | Menus & Toolbars" and reset desired toolbar/menu to their defaults at any time.

12) No. But you can create EMPTY document with no mouse involved at all: Alf+F, N, Enter, type full file name. If you are in Project View -- Alt+Insert (shortcut for "File | New").

You may try recording a macro that does what you need and assign shortcut for it (Settings | Keymap), but I do not think it will work here...

13) Caret is your cursor in editor. Not mouse cursor but actual editor cursor (that blinking vertical line or block (or whatever you may have on your computer/OS)). Caret row -- your currently active line in editor.

14) No (99.999%). Just use "Refactor | Rename". If you need to rename that single instance (out of few that would otherwise be changed by "Refactor | Rename") then just retype $ as part of new variable name.

0
Comment actions Permalink

Thanks for the informative responses. It will take me some to look over them and followup. In the meantime, here is the screen shot of the icon that appears. The way to reproduce this behavior is to add "New" to the toolbar. An icon will be auto added since "New" doesn't have one. Then remove it from the toolbar. (The icon sort of looks like a little alien's head.)

On 8: I'm a beginner at programming in general so excuse by bad descriptions. :)  I think I meant the functions arguments or parameters. Anyway, you got it.

Is there a way to make CTRL+F while in the scope of a function permanent - so that it pops up anytime you are in a function and I don't have to press the keyboard command?

Update: I forgot to mention that I tried resetting toolbars to defaults as you suggested (via "Restore All Defaults" on the customize toolbar menu) and it did not fix the problem.



Attachment(s):
icon.png
0
Comment actions Permalink
The way to reproduce this behavior is to add "New" to the toolbar. An icon will be auto added since "New" doesn't have one. Then remove it from the toolbar. (The icon sort of looks like a little alien's head.)

No idea why it does it. I mean -- when you add something to the toolbar it has to have an icon. Since "File | New" does not have one, the default one was assigned. I just do not know why resetting the main menu toolbar (as I have suggested) did not reset it for you.

You can search this Issue Tracker for some similar ticket and submit new one if you find none that matches your case: http://youtrack.jetbrains.com/issues/IDEA

Is there a way to make CTRL+F while in the scope of a function permanent - so that it pops up anytime you are in a function and I don't have to press the keyboard command?

Ctrl+F is in-page search. I assume you mean Ctrl+P.

And no -- you cannot (AFAIK). It only shows up automatically if you just typed function or when editing (adding new) parameters.

0
Comment actions Permalink

I did mean CTRL+P, thanks. I will submit a ticket later this week after becoming more familiar with the program.

0
Comment actions Permalink

Another few basic questions:

  1. What is that line thing is in the middle of the screen? Is it something to do with optimal line length? Looks like a fine dotted line running vertically down the coding area.
  2. How to use spellchecker in one click? Right now I have to right click the word> spelling> typo: change to...>(select replacement word).
  3. Is there a way to quickly go back to the document you just were on? As an example, suppose I navigate to a class by ctrl-clicking the class's name. Can I go back to the document I
    was in before I ctrl-clicked the class?
0
Comment actions Permalink

Most likely.

Settings | Code Style | General | Right margin (columns)

0
Comment actions Permalink

OOOPs, I edited my post as you were replying. I thought of a few more questions after I typed that one. Thanks for the quick reply though!

0
Comment actions Permalink

2. The almighty Alt+Enter -- it is context dependant and will show different entries in different situations.

3. Have you tried the most obvious "Navigate | Back" ?

0
Comment actions Permalink

alt+enter is displaying a pop-up. I can press enter again to get the first spelling suggestion (so alt+enter+enter). Do you know if the menu can be bypassed? Or if the spelling menu can be mapped? "spelling" doesn't return anything in the keymap preferences to map a shortcut, too. I'm trying to speed this up since I use it so often.

0
Comment actions Permalink
Do you know if the menu can be bypassed?

No (cannot be bypassed)

I'm trying to speed this up since I use it so often.

Alt+Enter, Enter is rather easy to type/press -- much faster than Ctrl+Alt+S or Ctrl+Shift+Alt+N since for pressing second Enter you do not need to move your hands any further.

P.S.
Make less spelling mistakes :) -- will be beneficial in places where spellchecker is not present.

0
Comment actions Permalink

It's only for comments, otherwise I take my time.:)

0

Please sign in to leave a comment.