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

17,242

Solution 1

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.

Solution 2

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

Solution 3

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.

Solution 4

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

Share:
17,242

Related videos on Youtube

Lee
Author by

Lee

Updated on June 17, 2022

Comments

  • Lee
    Lee almost 2 years

    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?

  • OsakaWebbie
    OsakaWebbie about 10 years
    Your Path suggestion assumes MAMP (as does the screencast). What if the devtools is on a VM? (I have a CentOS VM on Windows.)
  • Nikolaos Dimopoulos
    Nikolaos Dimopoulos about 10 years
    @OsakaWebbie it will be whatever the path of the tools are i.e. where you cloned the repository.
  • OsakaWebbie
    OsakaWebbie about 10 years
    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.
  • Gizzmo
    Gizzmo over 9 years
    Damn did not read the other answer until end... so may answer is contained i the upper...