public function __construct($argv) { $this->mode = 'com'; $this->app_env = Pi::get('app_env', ''); $this->com_env = Pi::get('com_env', ''); parent::__construct(); }
public function __construct() { if (!defined("APP_CTR_ROOT")) { die('please define APP_CTR_ROOT const'); } if (!defined("PI_APP_NAME")) { die('please define PI_APP_NAME const'); } $this->mode = 'web'; $this->app_env = Pi::get('app_env', ''); $this->com_env = Pi::get('com_env', ''); parent::__construct(); }
public function __construct($argv = array()) { if (!defined("APP_NAME")) { die("app.err please define APP_NAME const \n"); } $this->mode = 'api'; $this->app_env = Pi::get('app_env', ''); $this->com_env = Pi::get('com_env', ''); $data_type = Conf::get("global.data_type", 'json'); if (isset($this->data_types[$data_type])) { $this->data_type = $data_type; } parent::__construct(); }
public function __construct($argv = array()) { if (!defined("PI_APP_NAME")) { die("app.err please define PI_APP_NAME const \n"); } $this->mode = 'api'; $this->app_env = Pi::get('app_env', ''); $this->com_env = Pi::get('com_env', ''); $data_type = Pcf::get("global.data_type", 'json'); if (isset($this->data_types[$data_type])) { $this->data_type = $data_type; } parent::__construct(); if (true === $this->debug && php_sapi_name() == 'cli') { $mod_name = Pcf::get("global.mod", 'mod'); $func_name = Pcf::get("global.func", 'func'); Comm::setReq($mod_name, $argv[1]); Comm::setReq($func_name, $argv[2]); } }
public function __construct($argv) { if (!defined("APP_NAME")) { die('please define APP_NAME const'); } define('TASK_PATH', APP_ROOT . APP_NAME . DOT); $this->mode = 'task'; $this->app_env = Pi::get('app_env', ''); $this->com_env = Pi::get('com_env', ''); //得到参数 if (!empty($argv)) { array_shift($argv); $this->task_name = array_shift($argv); } if (empty($this->task_name)) { die('please input the task name for this process'); } $this->argv = $argv; parent::__construct(); }