A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Formatting/coloring log files on the fly with tail and sed

I often monitor MySQL queries for some complex application components that use an ORM (Doctrine). I’ve just made a special logger that re-runs all the quries with an EXPLAIN and log the “Extra” column of the explain query, in order to spot queries that can be improved. From the log, I pipe the result to [...]

When NOT to use a mysql subqueries

MySQL optimizer rewrites uncorrelated subqueries (when the inner query does NOT use fields of the outer query) as correlated query, with perrformances of quadratic order rather than linear.

If the inner query does not use a WHERE with fields on the outer query, rewrite it as a JOIN

Source: MySQL :: MySQL 5.5 Reference Manual :: [...]

Markdown, markup language

Markdown – Wikipedia, the free encyclopedia

Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people “to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)”.[1] The language takes many cues from existing conventions for marking up plain text in email.

[...]

Usage statistics and market share data of PHP on the web

Usage Statistics and Market Share of PHP for Websites, January 2012

This report shows the usage statistics and market share data of PHP on the web

How to create phpunit mock objects from namespaced classes

If the autoloader is enabled:

$mock = $this->getMockBuilder(‘MyNamespace\sub\ClassToMock’)       [...]

ZFDebug panel quick tutorial

In this post I’ll just write some notes to install the ZFDebug panel for Zend Framework. That’s basically a front controller plugin that displays at the bottom of the layout (slides from the bottom), contains “debug panels” (cache, variables, zend db, time info etc…) and it’s easy to extend.

Copy libraries and images

Grab the [...]

links for 2011-01-12

Profile your PHP application and make it fly Profile your PHP application and make it fly View more presentations from Lorenzo Alberton. [...]

PHP and scalability

As PHP is becoming a widely used web server technology, more and more developers are comparing PHP with other technologies like J2EE or .NET.It has been the butt of criticism as considered not scalable: totally wrong !

A system is scalable when is able to keep the performances under an increased load, mainly due to [...]

How to optimize PHP applications

There are lots of advices on the web about how to speed up PHP applications.The best reading I’ve found are written by Ilia Alshanetsky [blog]:

PHP & PERFORMANCE [pdf]By: Ilia Alshanetsky

Common Optimization Mistakes [pdf]PHP Quebec 2009

Enjoy !

benchmark: array_key_exists vs isset

When the aim is to check if the element exists in an array and has a value not null, better to use isset(array[index]), that is much faster than array_key_exists(index, array). #PHP 5.3.0 command line – Amd turion 64 1.6 Ghz #create array$a = array();for($i = 0; [...]