Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use phalcon-devtools\ide\phpstorm in phpstorm?

I am trying to integrate the Phalcon developer tools with phpstorm. There is a video here, but I am unable to view it due to my location.

I can't find any other usable reference in the documentation, how can I accomplish this?

like image 747
Lee Avatar asked Sep 05 '12 14:09

Lee


3 Answers

Here are the steps.

  • Make sure you have the phalcon-devtools installed Instructions
  • Create a project using phalcon-devtools (unless you already have a project)
  • Launch PHPStorm and create the project there (unless you already did that).
  • Click File-Settings (Ctrl+Alt+S) (or PHPStorm-Preferences for Mac)
  • Click the second option "Command Line Tool Support"
  • Click the + icon and a new popup comes up. Make sure you have "Custom Framework" selected
  • In the new popup type:

    Framework: Phalcon

    Tool path: /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/phalcon.sh

    Alias: phalcon

    Description: Phalcon Developer Tools

This assumes that your phalcon-tools have been installed under:

/Applications/MAMP/htdocs/phalcon-tools/

Also if you use a Windows environment, you should use phalcon.bat instead of phalcon.sh (see Tool Path line above)

  • Click Apply and then OK.
  • Click Tools - Run Command (Ctrl+Shift+X)
  • In the Commands output window, type:

    phalcon commands

You should be able to see output. If there is an error check your path. Type any of the phalcon-tools commands to generate components for your project.

  • In PHPStorm you should see in the project explorer "External Libraries". Right mouse click and select "Configure PHP Include Paths"
  • In the new dialog click the + and navigate to the /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/0.5.0 folder and click OK.

Now as you type code, the relevant helper popup will appear with all the relevant functions.

2012-09-07: There is a beta implementation of the Phalcon PHPStorm support for 0.5.0 here. In the upcoming weeks the code will become part of the framework and included with the 0.5.0 version.

like image 141
Nikolaos Dimopoulos Avatar answered Oct 23 '22 07:10

Nikolaos Dimopoulos


I had some problems with the execution of the phalcon.bat file on my Windows Dev machine, no PHP installed, so i research a much simpler solution for phpstorm.

Simply do following:

  • click on "External Libraries"
  • click on "Configure PHP Includes Paths..."
  • click on add
  • add "phalcon-devtools\ide\[YOUR_VERSION_DIRECTORY]"

Than you have code completion for phalcon:-)

like image 9
Gizzmo Avatar answered Oct 23 '22 05:10

Gizzmo


If you see the Phalcon module loaded in phpinfo page in your WAMP server, do the following to get loaded the module in CLI mode too.

Copy <WAMP INSTALATION >\bin\apache\<APACHE VERSION >\bin\php.ini to \bin\php\<PHP VERSION>\

Set php PATH to <WAMP INSTALATION>\bin\php\<PHP VERSION>\

That should solve the problem.

like image 1
Johna Avatar answered Oct 23 '22 07:10

Johna