Setting the auto_prepend_file Value

Hi all,
I'm evalutating PhpStorm, and have run into a problem. I use PHP's auto_prepend_file setting to include a script that contains a number of important defined constants. Because PhpStorm doesn't know about this file, it thinks all the defines in my scripts are undefined. Is there a way I can have PhpStorm automatically include my auto_prepend_file?

3 comments
Comment actions Permalink

Hi Sean,

Is there a way I can have PhpStorm automatically include my auto_prepend_file?

If there would be automatic way then you would not ask this question. Only manually: add path to folder that contains that file via "Settings | PHP" (such folder will appear in Project View under  External Libraries branch ... or via "Settings | Directories | Add Content Root" (will be treated as part of the project itself).

0
Comment actions Permalink

Thanks for the response, but I'm not trying to include an entire folder in my project. Only a single file.

0
Comment actions Permalink

PhpStorm has no functionality to reference single file outside of the project structure -- only folders (as mentioned before). You can place that single file in subfolder so only one file will be included.

If that is "too much and confusing" .. then why not utilize your OS functionality -- create symbolic link (any modern OS supports it) somewhere in a project folder that will point to that auto_prepend_file? No additional configuration from PhpStorm side required.

If your OS is too old and does not support symbolic links (e.g. Windows XP) .. then just copy that file somewhere within a project (of course, that's not ideal solution if you editing that auto_prepend_file file often as you will have to copy that file over after each modification to keep content synched, but that is not PhpStorm headache).

0

Please sign in to leave a comment.