Beispiel #1
0
/**
 * @param $base
 */
function cleanPackages($base)
{
    if ($dirs = @scandir($base)) {
        foreach ($dirs as $dir) {
            if (in_array($dir, array('.', '..'))) {
                continue;
            }
            $path = $base . $dir;
            if (is_dir($path)) {
                if (in_array($dir, array('tests', 'docs', 'gui'))) {
                    removeDir($path);
                } else {
                    cleanPackages($path . '/');
                }
            } elseif (pathinfo($path, PATHINFO_EXTENSION) != 'php') {
                unlink($path);
            }
        }
    }
}
Beispiel #2
0
<?php

$root = dirname(dirname(__FILE__)) . '/';
require_once $root . '_build/includes/functions.php';
$base = $root . 'core/components/minifyx/munee/';
// Clean base dir
if ($dirs = @scandir($base)) {
    foreach ($dirs as $dir) {
        if (!in_array($dir, array('src', 'config', 'vendor', '.', '..'))) {
            $path = $base . $dir;
            if (is_dir($path)) {
                removeDir($path);
            } else {
                unlink($path);
            }
        }
    }
}
// Clean vendors
$base = $root . 'core/components/minifyx/munee/vendor/';
cleanPackages($base);