SystemDaemon – Simple base for system daemons in PHP

SystemDaemon is a library that helps with writing system daemons and services in PHP.  PHP is not my personal favorite language for such tasks, but there is often a need, despite the preference.  Some examples are:

  • scheduled tasks (cron jobs) that need to execute more often than once per minute
  • message queue workers
  • real-time synchronization scripts

 

Kitab – documentation rendering and testing tool for PHP

Kitab is a handy tool for PHP developers that helps with two things:

  1. Render static HTML (with added search) from the doc-blocks in source code.
  2. Unit test the examples that are in the doc-blocks.

There are a number of tools that do the first one (phpDocumentor, Doxygen, Sami, etc).  However I don’t remember seeing anything that accomplishes the second task.

PHP object graph visualizer

koriym/print_o is an object graph visualizer for PHP.  Here’s a Wikipedia answer to the question of “What is an object graph?”:

Object-oriented applications contain complex webs of interrelated objects. Objects are linked to each other by one object either owning or containing another object or holding a reference to another object. This web of objects is called an object graph and it is the more abstract structure that can be used in discussing an application’s state.

This tool is similar to some of my GraphViz tools (CakePHP model visualization with GraphViz, and PHP class inheritance with GraphViz), but it’s a lot more generic, and looks like a lot more powerful.

Lesser known CSS quirks & advanced tips

Lesser known CSS quirks & advanced tips” is a collection of some really weird CSS features and behaviors.  These are good to know, as sometimes they can shed some light on strange results or help with implementation of a particular design feature, where no other options are applicable.

Have you tried Composer Scripts? You DO not need Phing.

Have you tried Composer Scripts? You may not need Phing.” is a nice blog post showing how to use Composer scripts to solve simple build and deployment automation.  There’s plenty of good advice in there.

However I have one issue with it.  It’s the “You may not need Phing.” part.  Irrelevant of your use of Composer scripts, you DON’T need Phing.  Phing had its time.  It was one of the first build and deployment tools for PHP and it was better than all the alternatives at the time (manual builds, custom shell scripts, or tools from other programming languages).

Those days are long gone and we have better tools now.  If you are still using (or even considering using Phing), I beg you to look another way.  Check out Deployer.  Check out Robo.li.  Check other alternatives.  Don’t use Phing.

What’s wrong with Phing? Well, I can sum it up in one and one reason only.  It’s XML-based.  Yeah, that’s right.  Phing routes come from Apache Ant, which is a very common build tool for the Java world.  And Java world is full of XML.

In the year of 2018, we’ve figured out better ways.  Both JSON and YAML are better alternatives to XML for both humans and machines.  JSON and YAML are easier to read and generate.

Furthermore, even XML is not the most appropriate format for what Phing is working with.  Sure, as long as you can stick with the basic configuration of existing tasks and options – it doesn’t make much difference.  But at some point, you’ll need to extend and customize your build and deployment process.  And you’ll eventually end up writing PHP code using XML syntax.  And trust me, there is no fun in that at all.

Use PHP to write PHP code.  Use PHP tools for your PHP projects.  We have these now and they are great.  At work we are using Robo.li very extensively and it works amazing!  You don’t have to use it.  Pick whatever works for you.  But if Phing works for you, you’re probably doing something wrong.

Oh, and yes, Composer scripts are awesome too.  Try them out, if you haven’t already.