Debug PHP like Pro: Intellij Idea + VirtualBox + XDebug

VirtualBox + XDebug overview

For a long time I used to use built-in PHP debugging function like var_dump, debug_backtrace, spl_object_hash etc. That tools are very useful but there is one tool combining all of them. I’m talking about XDebug PHP module. With XDebug you can stop code execution in any place you need and get all information about objects, variables and call stack in one window.

breakpoint overview

Continue reading “Debug PHP like Pro: Intellij Idea + VirtualBox + XDebug”

Power of Composer packages

About Composer Packages

Composer packages makes maintaining your code easier. For example, you have a small library which is used in a few projects at the same time. You want to add a new feature or fix a bug.

You can go through all projects which are using the library and update them. But what if new update needs to add new dependencies? You should add them manually too. It will take too much time and chance to break something is very high.

Another way is to package the library in a Composer package and make it accessible somewhere across the Internet (you actually don’t need make it public). In this case you update the code, add required dependencies in config and release a new version. After that, you just go through projects and run a single command in their root directory:

composer update

This is much easier than the previous scenario.

Continue reading “Power of Composer packages”