function boot($app_id = NULL) { if (empty($app_id) || !isset($this->__cobra['path.app'])) { throw new coEx(__METHOD__ . '::' . $app_id); } $app_id = __k_safe_str($app_id); $app_bootstrap = $this->__cobra['path.app'] . '/' . $app_id . '/' . COBRA_APP_BOOTSTRAP; if (!is_readable($app_bootstrap)) { throw new coEx(__METHOD__ . '::' . $app_id . '::' . COBRA_APP_BOOTSTRAP); } require_once $app_bootstrap; $app_sys = isset(${$app_id}) ? ${$app_id} : array(); $app_cfg = 'config'; $app_arr = array($app_id => array('sys.app' => $app_sys, 'sys.config' => isset(${$app_cfg}) ? ${$app_cfg} : array())); if (isset($this->__cobra['sys.apps'])) { $this->__cobra['sys.apps'] = array_merge($app_arr, $this->__cobra['sys.apps']); } else { $this->__cobra['sys.apps'] = $app_arr; } // set cache if (isset($app_sys['path.class'])) { $this->cache($app_id, $app_sys['path.class'], true); } return true; }
public function CallProcedureSelect($procedure = NULL, $arguments = NULL, $fields = NULL, $limit = COBRA_DB_SELECT_LIMIT, $offset = 0) { if (empty($procedure)) { throw new coDBEx(__METHOD__); } $procedure = __k_safe_str($procedure, COBRA_DB_PROCEDURE_NAME_SIZE); $fields = coStr::a2f($fields); $query = 'SELECT ' . $fields . ' FROM ' . $procedure; $query .= '(' . coStr::a2f($arguments, '', true) . ')'; return $this->Select($query, $limit, $offset); }