Skip to main content

Convert the Atom Editor into a PHP IDE using PHP Integrator

Atom Editor is basically a text editor on steroids. It is not an IDE for any language by default. Through the power of plugins, you can convert Atom into almost anything you wish, except a toaster.

Here I am documenting what I did in order to convert Atom Editor to a nice PHP IDE. You can do the same too using PHP Integrator and make it much easier to maintain your PHP projects in Atom.

Note: Throughout the guide, I'll indicate version numbers at the time of writing in brackets. This is only for reference, and you must always install the latest version of the software, not the version indicated here.
  1. Upgrade to the latest version of Atom (1.21.1).
  2. Install the package php-integrator-base (3.1.0). (File > Settings > Install)
  3. Atom will ask you to install dependencies. Say Yes. The dependencies are (at the moment):
    • atom-ide-ui (0.5.3) (previous versions used linter, but you should disable/remove that now as it will conflict with Diagnostics)
    • intentions (1.1.5)
    • project-manager (3.3.5)
       
  4. Download and install PHP 7.1 or above (if you don't have it already). I'm on Windows so I got the x64 NTS build (7.1.11). OS-specific instructions:
    1. Extract the downloaded ZIP into a folder of its own (Do not extract to your working folder, as the archive has all files at its root.)
    2. (Optional) Move and/or rename the folder to a convenient location like C:\Program Files\php or C:\php. You should see php.exe and other files upon opening the folder, like C:\Program Files\php\php.exe.
    3. Add the php folder to the system's PATH environment variable. Test this by opening a new Command Prompt and typing php -v.
    4. In the php folder, create a new text file called php.ini and copy the contents from the bottom of this guide. Save it.
    5. Test that the extensions are loading by typing php -a at the Command Prompt. If you didn't get any errors, you're good.
       
  5. Restart Atom. The PHP Integrator plugin will start downloading its core. Fair warning: This needs some time and downloads about 144 MB of data. You can monitor the progress in the Console of Developer Tools.
    1. First, the Composer Installer will install Composer.
    2. Then, Composer will install around 34 packages.
       
  6. Once done, open your PHP project as a "folder" in Atom (it should appear as a tree on the left pane).
  7. Click Packages > Project Manager > Save Project. Give it a good name and click Save.
  8. Click Packages > PHP Integrator > Set Up Current Project. PHP Integrator will start indexing your PHP project. It should be quick.
Once the indexing is done, open any PHP file in the project and try some things like:
  • Type a standard PHP function or method name to its full documentation as a tip.
  • Hold Ctrl and click a custom function call to jump to its definition.
  • Put the cursor on a function name and press Alt-Enter (or maybe Ctrl-Enter) to get the intentions menu. Select "Show Documentation".
  • Open the Diagnostics panel by clicking the (Error)(Warning) counts on the left side of the status bar.
  • Have fun!
I recommend installing the package php-integrator-autocomplete-plus (1.6.1) and other php-integrator-* NON-legacy additional packages to suit your needs, but PHP Integrator project has plans to merge these packages into the base. So do check whether the merge has been done. The package's readme file should tell you which supplementary packages are still separate from the base.

Tip: You can improve your PHP project to work better with PHP Integrator. Take a look at type hinting and docblock formatting here. Refactoring your project by these guidelines will give PHP Integrator the ability to suggest the correct types and documentation for your project's own code.

PS: Send the package creator some coffee beans. (Disclaimer: This won't send me any beans.)

php.ini file:
[PHP]
extension_dir = "ext"
extension=php_mbstring.dll
extension=php_openssl.dll
extension=php_pdo_sqlite.dll

(blank line at the end of file)

Comments

Popular posts from this blog

Disable auto save in JetBrains IDE software (IntelliJ IDEA, PyCharm, PhpStorm)

JetBrains provides the following IDE software: IntelliJ IDEA PhpStorm PyCharm RubyMine WebStorm AppCode CLion Google also provides Android Studio which is powered by the IntelliJ platform. If you come from a different IDE such as Eclipse, you will be unpleasantly surprised to find that JetBrains-branded IDEs automatically save everything the moment you look away. The proponents argue that as you work on your project, you should not have to worry about saving files. But to others, this auto-save behavior which is enabled by default is a curse that catches them by surprise, and a shocking departure from the workflow they are very much used to. You can change the behavior by altering some settings.

Make Samsung DVD-C350 region-free

Update 2: An anonymous commentator has shown me a way to make Region 1 players (such as DVD-H1080R) region-free by first converting it to Region 3, then applying my region-free hack below. For details, click here or look for a comment by an Anonymous user dated 18 April 2011. Update: The instructions in the original post below did not make the DVD player region-free. Instead it only locked it to region 1. Many thanks to Anonymous who posted the first comment on this post, I now have alternate instructions. Note: If you have edited the numbers menu (see original post) , I suggest you return it to the original settings you had backed up. A modified numbers menu may prevent the instructions below from working properly.

Group, Ungroup and Regroup disabled in Word

I was editing a Microsoft Word document which had a collection of shapes and text boxes grouped together. I wanted to modify some of the shapes, and therefore I had to ungroup them. But when I right-click the group and open the Group menu, all three options namely Group, Ungroup and Regroup are completely disabled or grayed out. I couldn’t figure out what’s wrong. This group of objects is perfectly ungroupable, and I can even select objects within the group. However, Microsoft Word 2007 is not letting me ungroup it. I searched the Internet for a solution, but did not find anything very useful. The closest I came across is this statement: “The type of Text Wrapping doesn't make any difference as long as it isn't In Line with Text.” ( Link here ) Anyway, I changed the text wrapping of the group of objects from ‘In line with Text’ to ‘Tight’ and viola! I could now ungroup it and edit it. The document got a bit messed up when I did so, but after I ungrouped, edited and regro