Ejemplo n.º 1
0
Archivo: qb.php Proyecto: scy/qb
/**
 * Test the installation.
 * This function checks some of the basic functionality of qb (for example class
 * autoloading) and shows the value of some internal constants as well as other
 * useful information like qbURL return values. It can be used to debug your qb
 * installation.
 * @return bool True if the function was executed to the end.
 */
function qb_test()
{
    header('Content-type: text/plain');
    echo "Hi. This is qb " . QB_VERSION . ", nice to meet you.\n";
    echo "If you can read this, you've included qb correctly and requested some tests.\n\n";
    echo "First of all, some basic settings and what they are set to:\n";
    echo "qb is installed in:   " . QB_LIBDIR . "\n";
    echo "Request origin:       " . QB_REQDIR . "\n";
    echo "Server document root: " . QB_DOCROOT . "\n";
    echo "Requested URI path:   " . QB_URIPATH . "\n\n";
    if (QB_OURAUTOLOAD) {
        echo "qb will take care of autoloading its own classes.\n";
        echo "If your application needs an __autoload() function, please define it\n";
        echo "before including qb and call qb_autoload(\$class) as a fallback.\n";
    } else {
        echo "You have defined your own class autoloader. If autoloading of qb's classes\n";
        echo "fails, make sure it is calling qb_autoload(\$class) as a fallback.\n";
    }
    echo "\nChecking class autoloading...\n";
    new qbException();
    echo "Class autoloading seems to be working.\n\n";
    echo "BaseDir is: " . qbURL::getBaseDir() . "\n";
    echo "BaseURL is: " . qbURL::getBaseURL() . "\n";
    echo "Thus, virtual file requested is: " . qbURL::getVFile() . "\n";
    echo "\nThis is the end of the automatic tests.\n";
    echo "Check out http://scytale.name/proj/qb/ if something doesn't work.\n";
    return true;
}