3 trait Pman_Core_RooTrait {
7 if (isset($this->_hasInit)) {
11 $this->_hasInit = true;
13 $boot = HTML_FlexyFramework::get();
15 $this->appName= $boot->appName;
16 $this->appNameShort= $boot->appNameShort;
17 $this->appModules= $boot->enable;
18 $this->isDev = empty($boot->Pman['isDev']) ? false : $boot->Pman['isDev'];
19 $this->appDisable = $boot->disable;
20 $this->appDisabled = explode(',', $boot->disable);
21 $this->version = $boot->version;
22 $this->uiConfig = empty($boot->Pman['uiConfig']) ? false : $boot->Pman['uiConfig'];
24 if (!empty($ff->Pman['local_autoauth']) &&
25 ($_SERVER['SERVER_ADDR'] == '127.0.0.1') &&
26 ($_SERVER['REMOTE_ADDR'] == '127.0.0.1')
33 function checkDebug($req = false)
35 $req = $req === false ? $_REQUEST : $req;
36 if (isset($req['_debug'])
42 method_exists($this->authUser,'canDebug')
44 $this->authUser->canDebug()
49 method_exists($this->authUser,'groups')
51 is_a($this->authUser, 'Pman_Core_DataObjects_Person')
53 in_array('Administrators', $this->authUser->groups('name'))
58 DB_DAtaObject::debuglevel((int)$req['_debug']);
63 function checkDebugPost()
65 return (!empty($_GET['_post']) || !empty($_GET['_debug_post'])) &&
67 method_exists($this->authUser,'groups') &&
68 in_array('Administrators', $this->authUser->groups('name'));
72 function dataObject($tab)
74 if (is_array($this->validTables) && !in_array($tab, $this->validTables)) {
75 $this->jerr("Invalid url - not listed in validTables");
78 $tab = str_replace('/', '',$tab); // basic protection??
80 $x = DB_DataObject::factory($tab);
82 if (!is_a($x, 'DB_DataObject')) {
83 $this->jerr('invalid url - no dataobject');
94 static $permitError = false;
96 function onPearError($err)
98 static $reported = false;
103 if (Pman::$permitError) {
110 $out = $err->toString();
115 foreach($err->backtrace as $b) {
116 $ret[] = @$b['file'] . '(' . @$b['line'] . ')@' . @$b['class'] . '::' . @$b['function'];
122 //convert the huge backtrace into something that is readable..
123 $out .= "\n" . implode("\n", $ret);