Easy PHP deployment with Capistrano

I am actually stunned how many PHP developers still remote into their production environment via SSH and manually run the necessary git commands to update their production branch. While that is the most advanced and flexible option available I dont think it makes sense for smaller projects where the deployment routine is pretty straightforward and if you’re creating websites with wordpress, using a reliable wordpress hosting is the best choice for this type of projects. There are some services that automate that process and are pretty good at it.

Continue reading

Calculating PHP time difference (time ago)

It is a common problem in any CMS to show the last time a modification has been made. Our function will elaborate a bit on the PHP time difference and allow the user option of “accuracy” or show how many time intervals to be included in the “time ago” statement. For example if an article was posted 2 years 4 months 5 hours 33 minutes and 10 seconds ago we can limit the function to show only 1 level of accuracy – years or more.

Continue reading