cron-expressions

Cron Expression Parser in PHP

Working with cron scheduling can many times be a frustrating affair. Although setting a few cron jobs at one time can be easy, calculating cron dates in the future in code can get time consuming quickly. The PHP cron expression parser described here can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression or calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.
(more…)

Read More

virtualbox

PHP 5.5 on Oracle VirtualBox

PHP 5.5 has added a nice support for Generators, which I’ll cover in some other post. I needed to test these new features and add some to old applications. However PHP has dropped support for Windows XP and Windows 2003 starting with PHP 5.5. and I still have a Windows XP machine (along with Ubuntu 14.0 LTS). Although I could install PHP 5.5 in Ubuntu, most of the time I’m using Windows. I decided to go with VirtualBox for installing PHP 5.5, as I have some legacy PHP applications that I want to upgrade to the new version, and VirtualBox makes it easier to switch between operating systems.
(more…)

Read More

custom-shortcodes

Adding WordPress like shortcodes to your web applications

One of the cool features of WordPress is its shortcode feature. There may be times one wished to add this capability to your PHP web applications. Recently I found one such library which allows you to add shortcode features to your web apps. The library discussed here implements WordPress style shortcode syntax as a standalone package. Its a small package and so can be easily integrated into you existing applications. Content from editors, databases, etc. can be scanned by the Shortcode Manager and the contents replaced by a custom callback.
(more…)

Read More

slim-rest

Create a quick REST API using Slim framework

During a recent client project, I frequently needed to access a remote database table and update the same for certain fields. This was accomplished using phpMyAdmin on the server. However, it was getting tedious and was prone to accidental updates and deletes. Also, a couple of other developers also needed to make changes to certain fields on the remote database from their local server.

This is all a tedious process and prone to errors. One solution was to create a quick REST api wrapper around the remote database, using which developers could update the database table without any risk of corrupting the data and also with the added benefit of updating the table programmatically.
(more…)

Read More

sphider0

Add a custom search engine to your site using PHP and MySQL

Search is an integral of all websites. Most of the current WordPress an other sites use a built-in search capability or rely on Google custom search. However, many a times you will want to add your own search engine which you can yourself control. This can be particularity useful if you have a small intranet. In this post we will see how to integrate a small PHP search engine into any website to add custom search capabilities.
(more…)

Read More