Exemple #1
0
<?php

header('Content-Type: text/css');
require_once 'csf/csf.php';
CSF::add_library_path('extlib');
CSF::load_library('lessphp/lessc.inc');
$whitelist = array('style.less');
$infile = $_SERVER['QUERY_STRING'];
if (!in_array($infile, $whitelist)) {
    exit;
}
$lc = new lessc($infile);
echo $lc->parse();
Exemple #2
0
 * @param   Exception   $e      The exception
 */
function CSF_html_exception_handler($e)
{
    echo "<p>" . "<strong>Fatal error:</strong> Uncaught exception '" . get_class($e) . "'" . "</p>\n" . "<dl>\n" . "<dd></dd>\n" . "<dt>Message:</dt>\n" . "<dd>" . ($e->getMessage() ? $e->getMessage() : '(none)') . "</dd>\n" . "<dt>Location:</dt>\n" . "<dd>" . $e->getFile() . ", Line " . $e->getLine() . "</dd>\n" . "<dt>Stack trace:</dt>\n" . "<dd><pre>" . $e->getTraceAsString() . "</pre></dd>\n" . "</dl>\n";
}
/**
 * Library autoloader
 *
 * Uses {@link spl_autoload_register spl_autoload_register} to add an autoload 
 * callback which will attempt to load classes by calling CSF::load_library 
 * (using the lowercase of the class name).
 *
 * @param   string  $name   Class name
 * @return  boolean         TRUE on success, FALSE on failure
 */
function CSF_library_autoload($name)
{
    try {
        CSF::load_library(strtolower($name));
    } catch (CSF_LibraryNotFound $e) {
        return false;
    }
    return true;
}
/********************************************************************
 * CSF setup - extra bits of initialisation that MUST be done
 *******************************************************************/
// Add the default library and module paths
CSF::add_library_path(CSF_PATH . DIRECTORY_SEPARATOR . 'libraries');
CSF::add_module_path(CSF_PATH . DIRECTORY_SEPARATOR . 'modules');