<?php
function _preload( $path, *string $pattern = '/\.php$/'*)
{
if ( is_dir( $path ) ) {
if ( $dh = opendir( $path ) ) {
while ( ( $file = readdir( $dh ) ) !== false ) {
if ( $file !== '.' && $file !== '..' ) {
_preload( $path . '/' . $file, $pattern );
}
}
closedir( $dh );
}
} else if ( is_file( $path ) && preg_match( $pattern, $path ) ) {
if ( *!opcache_compile_file($path)* ) {
trigger_error( 'Preloading Failed', E_USER_ERROR );
}
}
}
_preload( '/var/www/ZendFramework/library' );