Logo: www.jetbrains.com
Today I discovered some neat features and plugins in PHPStorm worthy of sharing; these features made my life so much easier. While I was getting to know the features, I realized something. I was not really using my IDE to its full potential and probably after finding these new toys, I will still not be even close.
So I started using the database manager of PHPStorm and found out it was pretty awesome! And, it just suited my needs. While I was looking for tips and tricks to use the database manager, I came across all kinds of cool toys. Therefore, in this article I will tell you guys about the things in my IDE that make my life as a developer a lot easier. I hope it will make your lives at least a little bit easier too 😉
1. Speed up indexing by skipping folders.
At Polder Knowledge, we always try to make our apps fast. One of the techniques we use to make our apps fast is minification of Javascript and CSS source files. Also, for some apps we generate image sprites. But everytime we ran the minification tool, the IDE hanged for a bit. So I started looking for why it did and I found that every time we generated our web-assets the IDE started a new round of indexing. And it was indexing a lot! Which made the PHPStorm very slow. This is how you skip the folders where the generated files are placed:
- Go to File → Settings
- Go to the Directories tab
- Find the folders you want to exclude from indexing and select them
- Click the red folder to exclude them from the indexing process
2. Database management
Personally I do not do heavy database managing. Instead of installing an external tool for every type of database we had, I started using the built-in PHPStorm database manager. It has all of the basic tools database administration needs, such as a Query console, data editing, database dumping, data exporting and importing.
- On the right side of the IDE there is a database tab. Click on it and it will expand
- Hit the green plus in the left top of this tab
- Choose your data source and another tab will open
- Here you can fill in the details of the database
- Hit apply and OK and your set
Now you can see all your database tables.
A little extra hint: a lot of the options and features are hidden under right mouse clicks on different elements.
3. MongoDB plugin
You might have seen the little tab above the database tab in my IDE in the previous screenshot. This is the MongoDB explorer plugin. Because we have an app with a MongoDB collection, I thought it would come in handy. You can find this one in the plugin repositories. After installation, you will be presented with a configuration window. You can use this with a local MongoDB server or a remote one. With this plugin you also get an Query console and a neat little filter.
4. Docker and docker-compose support 🙂
I am now deploying docker containers and networks via a push of a button! Restarting, inspecting and checking the logs of a container is not far away either. Here is how easy it is done:
- Go to your settings
- Go to the build execution and deployment
- Choose Docker – If there is not already an entry add an entry by hitting the +
- Depending on the OS you use, choose how you want to connect to docker. For Linux you can just choose the unix socket. For OSX it is the
- Docker machine bullet and for all remote docker instances you choose the TPC bullet.
- Apply your settings
- Now in the bottom bar you see a tab with the docker option
- When you click on it, it opens the tab. To connect to your docker, right click on the name of your docker connection and click connect. Now you can see all your containers and see the status of each of your containers.
5. The built-in Terminal
This is just a little terminal to do your quick commands without alt-tabbing to another screen. You can find it in the left bottom of the IDE.
NOTE: all of these tips and tricks are for the PHPStorm IDE. Some tips may also apply for other JetBrains IDE’s