5 comments
Comment actions Permalink

I'd love some thoughts from the JetBrains folks on this.....

0
Comment actions Permalink

Hi Dave,

What do you mean by "auto import"?

Generally speaking, there is no "import file" action available in PhpStorm. You either

  • just copy files/folders into a project (they will be part of the actual project, stored in project folder on disk)
  • or reference external libraries via Settings | PHP (similar to what include_path in php does -- used for code completion etc)


P.S.
Not JB folk .. but I hope you do not mind.

0
Comment actions Permalink

For example:

If in my code I have the following line:

$accountVO = new AccountVO();

I'd like there to be a way to automatically have the following line automatically added to my code.

include_once 'model/AccountVO.php';

Thanks for the reply!

Dave

0
Comment actions Permalink

Hi Dave,

There is no such functionality present in current version of PhpStorm.

There is a ticket for similar functionality ( http://youtrack.jetbrains.com/issue/WI-1362 ) but that is for "namespace" and "use" statements only (nothing to do with include/require).

You may submit new Feature Request for your case (that's in case there is no such ticket already -- possibly I've missed it) on Issue Tracker: http://youtrack.jetbrains.com/issues/WI

P.S.
I think using autoloading functionality of PHP instead will be more beneficial and easier than waiting for such ticket to be implemented (which I do not expect to see implemented very soon). No need to add new/remove unused include/require statements -- just register you loader that will search for them in appropriate places; with properly chosen class names etc it will be almost as fast as manual include/require approach.

0
Comment actions Permalink

Hi Andriy,

Thanks. Looks interesting. Curious about performance impacts.

0

Please sign in to leave a comment.