public function __construct($log = NULL) { if (empty($log)) { throw new coEx(__METHOD__); } $log = __k_str($log); $c2 = __k_fetch("c2"); $this->__log = $c2['path.log'] . '/' . $log . '.log'; }
public function ProcSelect($p = NULL, $a = NULL, $f = NULL, $l = C2_PDB_LIMIT, $o = 0) { if (empty($p)) { throw new c2Ex(__METHOD__); } $p = __k_str($p, C2_PDB_LENGTH); $q = 'SELECT ' . c2Str::a2f($f) . ' FROM ' . $p; $q .= '(' . c2Str::a2f($a, '', true) . ')'; return $this->Select($q, $l, $o); }
function boot($app = NULL) { if (empty($app) || !isset($this->__c2['path.app'])) { throw new c2Ex(__METHOD__ . '::' . $app); } $app = __k_str($app); $app_h = $this->__c2['path.app'] . '/' . $app . '/h.php'; if (!is_readable($app_h)) { throw new c2Ex(__METHOD__ . '::' . $app_h); } require_once $app_h; $app_sys = isset(${$app}) ? ${$app} : array(); $app_cfg = 'cfg'; $app_arr = array($app => array('sys.app' => $app_sys, 'sys.c' => isset(${$app_cfg}) ? ${$app_cfg} : array())); if (isset($this->__c2['sys.app'])) { $this->__c2['sys.app'] = array_merge($app_arr, $this->__c2['sys.app']); } else { $this->__c2['sys.app'] = $app_arr; } // set cache if (isset($app_sys['path.class'])) { $this->cache($app, $app_sys['path.class'], true); } return true; }
protected function _s($s = NULL) { return __k_str($s, C2_SES_LENGTH); }