18

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?

Tim Post
  • 33,371
  • 15
  • 110
  • 174
Lee
  • 229
  • 1
  • 2
  • 7

4 Answers4

23

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.

Nikolaos Dimopoulos
  • 11,495
  • 6
  • 39
  • 67
  • Your Path suggestion assumes MAMP (as does the screencast). What if the devtools is on a VM? (I have a CentOS VM on Windows.) – OsakaWebbie Mar 25 '14 at 03:17
  • @OsakaWebbie it will be whatever the path of the tools are i.e. where you cloned the repository. – Nikolaos Dimopoulos Mar 25 '14 at 12:57
  • The only copy of the tools I have are on the VM, and cloning the repo to the Windows host wouldn't do any good unless I also install a webserver, PHP, and Phalcon there. The instructions seem to assume a dev environment on MAMP or WAMP, not a VM. – OsakaWebbie Mar 25 '14 at 23:19
9

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

Gizzmo
  • 691
  • 8
  • 21
1

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.

Johna
  • 1,836
  • 2
  • 18
  • 29
1

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

Roscko
  • 11
  • 2