pack(); $t2 = microtime(true); $time = sprintf('%.4f', ($t2 - $t1) ); echo 'script ', $src, ' packed in ' , $out, ', in ', $time, ' s.', "\n"; file_put_contents($out, $packed); chmod($out,0777); } function salvatudojs($jsfiles,$buffer,$final) { //junta todos os js em um unico foreach ($jsfiles as $f) { $abre = fopen($f, "r"); while (!feof($abre)) {$buffer .= fgets($abre);} fclose($abre); $buffer .= "\n"; } $abre = fopen($final, "wt"); $escreve = fwrite ($abre,$buffer); $fecha = fclose ($abre); chmod($final,0777); } ?>