Ejemplo n.º 1
0
function compile($compressedFiles, $app, $nameInclude, $compile, $delete)
{
    $compressor = new Compressor();
    $compressor->setCompressorType('js')->setPath(realpath(APP_PATH . '/' . $compressor->getFilesDir($nameInclude, $compressedFiles)))->setFiles($compressedFiles->files[$nameInclude])->setFilename($nameInclude);
    if ($delete == true) {
        echo "Deleted: " . $compressor->getCombinedFilePath() . "<br/>\n";
        unlink($compressor->getCombinedFilePath());
        echo "Deleted: " . $compressor->getCompiledFilePath() . "<br/>\n";
        unlink($compressor->getCompiledFilePath());
    }
    if ($compile == true) {
        $compressor->compile(true);
        echo "Compiled: " . $nameInclude . "<br/>\n";
    }
}