Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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:-)

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.

It has since been changed,

"As part of our restructuring and working towards a better more robust framework in terms of features as well as organization, we have removed the IDE stubs from the Phalcon DevTools repository and moved to its own repository."

The new instructions are located here: https://blog.phalconphp.com/post/phalcon-ide-stubs-repository

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top