<?php

    require (SYSTEM_PATH . 'core/Common.php');

    $config =& loadClass('Config', 'Core');
    $vendor =& loadClass('Vendor', 'Core');

    $input =& loadClass('Input', 'Core');
    $uri =& loadClass('URI', 'Core');

    $hook =& loadClass('Hook', 'Core');
    $loader =& loadClass('Loader', 'Core');
    $router =& loadClass('Router', 'Core');

    $db =& loadClass('DB', 'db');

    $page =& loadClass('Page', 'Core');
    $curPage =& $page->getInstance();
    $method = $router->method;

    $loader->autoload();

    $curPage->$method();
?>

<?php

    require (SYSTEM_PATH . 'core/Common.php');

    $config =& loadClass('Config', 'Core');
    $vendor =& loadClass('Vendor', 'Core');

    $input =& loadClass('Input', 'Core');
    $uri =& loadClass('URI', 'Core');

    $hook =& loadClass('Hook', 'Core');
    $loader =& loadClass('Loader', 'Core');
    $router =& loadClass('Router', 'Core');

    $page =& loadClass('Page', 'Core');
    $curPage =& $page->getInstance();
    $method = $router->method;

    $db =& loadClass('DB', 'db');

    $loader->autoload();
    $curPage->$method();
?>

Change database load proprity after the page is loaded
Change database load proprity after the page is loaded
