Move legacy PHP project to the modern Laravel ecosystem

Move legacy PHP project to the modern Laravel ecosystem

Legacy projects can be a pain – you have to not just support an old code but add new features. And at some point this may become a nightmare. However, there are many ways to upgrade it without full re-development at one time. One possible solution is to move such projects to the modern Laravel ecosystem as it’s described in this article. The idea behind […]

Read Me Leave comment

Allow inline line breaks for Monolog

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: $logger = new Monolog\Logger(‘MyLoggerName’); $formatter = new Monolog\Formatter\LineFormatter( null, // Format of […]

Read Me Leave comment

CakeFest 2011

I couldn’t participate CakeFest 2011 which was on September 1st – 4th in Manchester, UK. But at least I’d see slides of speeches. I found a few of them: Evented applications with RabbitMQ and CakePHP Really Rapid Admin Application Development Ch ch-changes cake php2 Tips of CakePHP and MongoDB Internationalizing your application Full-Stack CakePHP Deployment Going crazy with Node.JS and CakePHP Enjoy!

Read Me Leave comment

Fix for WP plugin Flickr Photo Album

I use the WP plugin Flickr Photo Album a few years. Together with Firefox plugin Fotofox it makes inserting procedure of images into posts very simple. However, I found a problems with that plugin recently. I couldn’t activate it anymore. The page is just reloaded and plugin’s status remained ‘Inactive’. This simple modification fixes the problem. In the file tantan-flickr/flickr/class-admin.php change add_action to register_activation_hook function […]

Read Me Leave comment

Installation of Oracle client to Ubuntu 10.04 Lucid

Recently I moved from Fedora 13 to Ubuntu 10.04 on my work laptop. So, I faced again with problem to setup Oracle PHP interface. Oracle provides RPMs only and not DEBs. So, to install the client RPMs should be converted to the DEBs. It can be done easily using utility alien: sudo alien oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm sudo alien oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm sudo alien oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm They can be installed then […]

Read Me 2 Comments

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 in your view: <?php echo $my_var; ?> The phrase ‘Hello […]

Read Me Leave comment

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”; } else { echo “This’s an existing object\n”; } That […]

Read Me 2 Comments

How to change WP password into database

I did it a few times but always made a search and dug WordPress code. So, just generate a new password: PHP -r ‘echo crypt(“new_wp_pass”) . “\n”;’ and update specified user in the table wp_users: UPDATE wp_users SET user_pass=’generated password hash’ where ID=’desire user ID’;

Read Me Leave comment