A few questions while evaluating PHPStorm

For reference I'm on a Mac so I'm using Cmd instead of Ctrl for some of the keyboard shortcuts.

  1. From the editor, what is the preferred, or fastest way, to create a new file in the project from the keyboard?

    I can
    cmd + 1
    , then
    cmd + n
    . Is that how YOU would do it? Is there a better, faster way?
  2. When in the editor, how can I tell if a file has been saved or not? Is there some sort of visual clue I'm missing?
  3. I tried to edit a single file that was on the server. As I was editing it, the file was continously saving to the server even though I had saved the file. Is there a setting for this?
  4. I would consider myself an experienced beginner with PHP. I have an
    folder where I have a  
    file. I have set the inc directory as the resource root so that when I invoke the auto complete command after typing  
    include 'inc/' 
    it will show the files listed in the inc directory. Is this the correct way to set that up?

Thank you for your help.

1 comment
Comment actions Permalink

Hi there,

1) No idea -- I'm using mouse for that.

2) Preferences | Editor | Editor Tabs | Mark modified tabs with asterisk


As I was editing it, the file was continously saving to the server even though I had saved the file.

I'm confused here.

In any case: such frequent autosave (after typing a letter or two) usually happens when:
a) You have File Watcher that compiles this file (JS/CSS/LESS/SASS/etc) and you have set it up for "Immediate file synchronization"
b) You have Live Edit enabled and you were in live edit session


First of all "Resources root" type of folder works for web resources only (e.g. references to js/css/image files) and not for PHP.
Secondly -- you should mark parent folder of that "inc" folder (assuming that it would work this way) as file references are resolved against Resource ROOT

Assuming you have this folder structure of your project:
Website root is located in "PROJECT_ROOT/httpdocs" folder. Now, if we reference "logo.png" file as "/assets/images/logo.png", then "httpdocs" folder must be marked as resource root to avoid unresolved file/resource warning.

For PHP the include/require paths are resolved against project/content root or current folder (where current file is located). But you can make path relative (e.g. include "../inc/file.php") or reference some constant there (e.g. include DIR_APP . "inc/file.php").

These days almost every modern framework uses OOP and classes. So all logic of including such files is done inside class loaders -- you just reference the class and loader does the rest automatically.


Please sign in to leave a comment.