Homework deadlines in conky using php script

The goal

In the summer of 2016 I started my masters in software development at IT University in Copenhagen. Knowing myself I knew I was going to need a system for keeping track of all my reading and assignments. I needed an overview that was easily accessible and easily kept up to date in regards to upcoming deadlines across different courses.

Tags php conky project management

PHP by reference

I've known for some time that in PHP you can pass by reference like this:

function doSomthing($a, &$b) {

By defining a function this way the $b parameter will be passed by reference, meaning if you change $b inside the function it will also be changed for the caller. An example:

Tags php

Validate PHP code from Sublime Text 2

If there's an error in your php code you might not always get an output of the error.

Since php can't be be compiled, we don't get the code validated at runtime. Instead we can run php with the -l flag:

$ php -l myfile.php

This will hopefully say No syntax errors detected in myfile.php. But if there is an error, you will get something like this:

Tags sublime text 2 php

Use of empty()

According to Stack Overflow it is bad practice to use empty() when check a value that is returned from a function, because when a function has be called there will always be a result. See further explanation in the answer.

Tags php