Define different code parts for Local and Remote?

Hello! In PhpStorm, is it possible to have different code executed depending from whether the PHP script is executed LOCALLY or REMOTELY, without having to use if-else?

I could imagine something like this:

{DEF LOCAL}
DoThis();
{LOCAL END}
//
{DEF REMOTE}
DoThat();
{REMOTE END}

When deployed, everything from above would be automatically deleted from the remote copy except of DoThat();

Is there something similar in PhpStorm?

Message was edited by: Peter Panino

1 comment

Hi there,

It is not possible.

And I, personally, see no reason why this should be an IDE job at all. Plus, you will become IDE-dependant (which means -- somebody else using other tools will not be able to work with your project straight away). You better have 2 separate files (one for local and one for remote) and include/execute only one of them as required.

0

Please sign in to leave a comment.