Пример #1
0
    }
    include "./loader.php";
    $loader = new YAHOO_util_Loader($yuiVersion);
    $base = PATH_TO_LOADER . $loader->comboDefaultVersion . "/build/";
    //Defaults to current version
    //Detect and load the required components now
    $baseOverrides = array();
    $yuiComponents = array();
    foreach ($yuiFiles as $yuiFile) {
        $parts = explode("/", $yuiFile);
        if (isset($parts[0]) && isset($parts[1]) && isset($parts[2])) {
            //Add module to array for loading
            $yuiComponents[] = $parts[2];
        } else {
            die('<!-- Unable to determine module name! -->');
        }
    }
    //Load the components
    call_user_func_array(array($loader, 'load'), $yuiComponents);
    //Set cache headers and output raw file content
    header("Cache-Control: max-age=315360000");
    header("Expires: " . date("D, j M Y H:i:s", strtotime("now + 10 years")) . " GMT");
    header("Content-Type: " . $contentType);
    if ($contentType == "application/x-javascript") {
        echo $loader->script_raw();
    } else {
        echo $loader->css_raw();
    }
} else {
    die('<!-- No YUI modules defined! -->');
}