Пример #1
0
 /**
  * 获取数据
  * @param $key
  */
 public function get($key = '')
 {
     if (list($file, $name) = lode('@', $key)) {
         if (isset(static::$_config[$file][$name])) {
             return static::$_config[$file][$name];
         }
         $config = $this->getConfiguration()->getConfLoad($file);
         if (is_array($config)) {
             return $config[$name];
         }
     }
     return false;
 }
Пример #2
0
 /**
  * 设置模板控制器
  * @param $name
  */
 private function setAutoPath()
 {
     $request = Config::get('sys@request');
     $lode = lode('\\', $request['action']);
     if (isset($lode[2])) {
         $name = $lode[2];
         if (substr($name, -6) == 'Action') {
             $this->_actionName = strtolower(substr($name, 0, -6));
         }
         $this->_path = host() . APP_NAME . '/view/' . $this->_actionName;
     } else {
         throw new UpaddException('控制器模板目录设置失败');
     }
 }
Пример #3
0
 private function checkType()
 {
     $type = lode('/', $this->_type);
     $this->_type = $type[1];
     //        p([$this->_getFile,$this->_fileTypeArr,$this->_type,$type,$this->_tmp_name,$this->_name]);
     if (!in_array($this->_type, $this->_fileTypeArr)) {
         msg(206, '警告:上传的类型不合法');
     }
 }
Пример #4
0
 /**
  * 查询字段
  * @param null $_field
  * @return array|null|string
  */
 private function lodeField($_field = null)
 {
     $Field = '';
     if (Verify::IsNullString($_field)) {
         $Field = ' * ';
     } elseif (Verify::isArr($_field)) {
         $Field = lode(',', $_field);
     } elseif (is_string($_field)) {
         $Field = $_field;
     }
     return $Field;
 }
Пример #5
0
 /**
  * 查询字段
  * @param null $_field
  * @return array|null|string
  */
 protected function joint_field($_field = null)
 {
     if (Verify::IsNullString($_field)) {
         $this->_field = ' * ';
     } elseif (Verify::isArr($_field)) {
         $this->_field = '`' . lode("`,`", $_field) . '`';
     } elseif (is_string($_field)) {
         $this->_field = $_field;
     }
     return $this->_field;
 }
Пример #6
0
 /**
  * 返回机器名称
  * @return string
  */
 function getMachineName()
 {
     $os = lode(" ", php_uname());
     if ('/' == DIRECTORY_SEPARATOR) {
         $os = $os[1];
     } else {
         $os = $os[2];
     }
     $osName = $os;
     //strtolower($os);
     return $osName;
 }
Пример #7
0
 /**
  * 查询条数
  * @param null $param in array,string
  * @return $this
  */
 protected function limit($param = null)
 {
     $tmp = 'LIMIT ';
     if (is_array($param)) {
         $tmp .= lode(',', $param);
     } elseif (is_string($param)) {
         $tmp .= $param;
     } else {
         throw new UpaddException('limit()参数错误');
     }
     $this->setLimit($tmp);
     return $this;
 }
Пример #8
0
 /**
  * 获取参数
  * @param $key
  * @return bool
  */
 public static function get($key)
 {
     if (list($_key, $val) = lode('@', $key)) {
         if (isset(static::$_configData[$_key][$val])) {
             return static::$_configData[$_key][$val];
         }
     }
     return false;
 }
Пример #9
0
 /**
  * 设置请求参数
  * @param      $spec
  * @param null $value
  * @return $this
  */
 private function setGetParam($val)
 {
     $val = substr($val, 0, -1);
     $val = lode(',', $val);
     foreach ($val as $k => $v) {
         $tmpLode = lode(':', $v);
         if (count($tmpLode) == 2) {
             list($_key, $value) = $tmpLode;
             Data::accept([$_key => $value]);
         }
     }
 }