Tag Archives: PHP

Allow inline line breaks for Monolog

By default Monolog ignores line breaks inside debug message and puts it in one line. That’s fine for GrayLog or something similar but is not handy for me during local development. The fix is easy. Just add new Formatter with allowInlineLineBreaks option in true to your StreamHandler and enjoy formatted dumping of arrays:

Tags: , ,

Trick with variable name transformation in CakePHP

CakePHP is a good PHP MVC framework. You can study it easily and start developing web sites very fast. But it has some disadvantages, of course. One of them is strange rules for transformation variable name when it set in the controller. Statement $my_var = ‘Hello world!’; $this->set(‘my_var’, $my_var); will make the variable $my_var accessible… Continue reading →

Tags: , , ,

SugarCRM: check updating of object’s property

Sometimes it’s needed to know about updating of specified object’s property. SugarCRM keeps previous values for all object’s properties in the array fetched_row. For example, to realise it’s new object or just updated we should compare ID from that array and current value of object’s property: if($obj->fetched_row[‘id’] != $obj->id) { echo “This’s a new object!\n”;… Continue reading →

Tags: ,

Managing Standalone Scripts in PHP: part II

The second article about using standalone PHP script shows amazing ability of PHP such as fork, signals and demonizing. Yes, PHP allows to catch signals like SIGINT, SIGHUP, SIGALRM and so on. It’s really cool! When I develop background utils for SugarCRM I didn’t know about those useful PHP features. So, it’s time to make… Continue reading →

Tags: , , , ,

Get Adobe Flash player