Exemplo n.º 1
0
}
if (!isset($PROFILER_ENABLED)) {
    $PROFILER_ENABLED = isset($_SERVER['PROFILER_ENABLED']) ? $_SERVER['PROFILER_ENABLED'] : 0;
}
if (!isset($PROFILER_ENABLED)) {
    $PROFILER_ENABLED = 1;
}
if (!isset($PROFILER_DISPLAY)) {
    $PROFILER_DISPLAY = 1;
}
if (!isset($INIT_NO_SUDO)) {
    $INIT_NO_SUDO = 0;
}
require_once ROOT_DIR . '/rm_autoload.php';
if ($PROFILER_ENABLED) {
    PROFILER_START('Graphic', array('image-url' => '/img/profiler'));
    PROFILER_IN('init');
}
function __autoload($class)
{
    PROFILER_IN('__autoload');
    #PROFILER_CNT('class',PROFILER_CNT('class',NULL)."; $class");
    @($GLOBALS["mem_req"] -= memory_get_usage());
    require_once rm_class2file($class);
    $GLOBALS["mem_req"] += memory_get_usage();
    PROFILER_OUT('__autoload');
}
if ($USE_EXCEPTION_HANDLERS) {
    M('Base')->setExceptionHandlers(array('RM_Base_Exception_Internal', 'RM_Ssp_Exception_Handler->onInternal'), array('Exception', 'RM_Ssp_Exception_Handler->onInternal'));
}
if (!@$INIT_MENU && !@$INIT_LIGHT) {
Exemplo n.º 2
0
#$GLOBALS['PROFILER_DUMPTRACE'] = 1;
$GLOBALS['PROFILER_DUMPTRACE_FILE'] = ROOT_DIR . '/t/dump';
require_once ROOT_DIR . '/rm_autoload.php';
function __autoload($class)
{
    if (file_Exists($file = rm_class2file($class))) {
        require_once $file;
    } else {
        echo "<PRE>";
        debug_print_backtrace();
        echo "</PRE>";
    }
}
M('Config')->init(ROOT_DIR . '/t/test.xml');
register_shutdown_function('PROFILER_STOP');
PROFILER_START();
class RM_Test_Facade implements RM_Guid_iObject
{
    protected $id, $type;
    public function __construct($id = NULL)
    {
        $this->id = $id;
    }
    public function guidType()
    {
        return 'test';
    }
    public function guidId()
    {
        return $this->id();
    }