Esempio n. 1
0
 */
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');