getPathname(), $p)) { $skip = true; break; } } if ($skip) continue; if ($file->isDir()) { echo 'Get files in: '.$file->getPathname()."\n"; } else { $pathinfo = pathinfo($file->getPathname()); if ($pathinfo['extension'] == 'php') { $files[] = $file->getPathname(); $size += $file->getSize(); } } } sort($files); foreach ($files as $file) { echo '.'; $return = 0; $tmp_out = array(); exec('php -w '.escapeshellarg($file), $tmp_out, $return); if ($return != 0) { die('error'); } if ($tmp_out[0] == '') { echo('>> '.$file."\n"); } $output = array_merge($output, $tmp_out); } echo "\n"; echo 'Compiled files: '.count($files)."\n"; file_put_contents($output_file, ''); echo('Final size: '.(int)(100*filesize($output_file)/$size).'%'."\n"); ?>