zendframework/zf1 — pull request #164 by nicolas-grekas (2013-07-11 08:59:49+00:00)
Title: Fix ZF-11921: Race condition in plugin loader include file cache

This fixes the race condition described at:
http://framework.zend.com/issues/browse/ZF-11921

For the race to disappear each and every line is made completely independent from the others. This is the reason why every line includes its own php open and close tag, and no file_get_content() is made, and the file is opened in append only mode.

To prevent the insertion of duplicates lines, a fast non blocking lock is made and kept until the end of the request, thus the static $h.

Tested on a highly concurrent server without a problem.