Skip to content

Commit

Permalink
bump to 2.2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywhalecc committed Jan 29, 2021
1 parent b74cf29 commit 5386662
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "composer project of zhamao-framework-starter",
"minimum-stability": "stable",
"license": "Apache-2.0",
"version": "2.1",
"version": "2.2",
"type": "project",
"prefer-stable": true,
"scripts": {
Expand All @@ -16,7 +16,7 @@
"systemd": "vendor/bin/start systemd"
},
"require": {
"zhamao/framework": "^2.1"
"zhamao/framework": "^2.2"
},
"require-dev": {
"swoole/ide-helper": "@dev"
Expand Down
12 changes: 9 additions & 3 deletions config/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,19 @@

/** 轻量字符串缓存,默认开启 */
$config['light_cache'] = [
'size' => 1024, //最多允许储存的条数(需要2的倍数)
'max_strlen' => 16384, //单行字符串最大长度(需要2的倍数)
'size' => 512, //最多允许储存的条数(需要2的倍数)
'max_strlen' => 32768, //单行字符串最大长度(需要2的倍数)
'hash_conflict_proportion' => 0.6, //Hash冲突率(越大越好,但是需要的内存更多)
'persistence_path' => $config['zm_data'].'_cache.json',
'auto_save_interval' => 900
];

/** 大容量跨进程变量存储(2.2.0可用) */
$config["worker_cache"] = [
"worker" => 0,
"transaction_timeout" => 30000
];

/** MySQL数据库连接信息,host留空则启动时不创建sql连接池 */
$config['sql_config'] = [
'sql_host' => '',
Expand Down Expand Up @@ -72,7 +78,7 @@

/** HTTP服务器固定请求头的返回 */
$config['http_header'] = [
'X-Powered-By' => 'zhamao-framework',
'Server' => 'zhamao-framework',
'Content-Type' => 'text/html; charset=utf-8'
];

Expand Down
6 changes: 3 additions & 3 deletions src/Module/Example/Hello.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public function hello() {
*/
public function randNum() {
// 获取第一个数字类型的参数
$num1 = ctx()->getArgs(ZM_MATCH_NUMBER, "请输入第一个数字");
$num1 = ctx()->getNumArg("请输入第一个数字");
// 获取第二个数字类型的参数
$num2 = ctx()->getArgs(ZM_MATCH_NUMBER, "请输入第二个数字");
$num2 = ctx()->getNumArg("请输入第二个数字");
$a = min(intval($num1), intval($num2));
$b = max(intval($num1), intval($num2));
// 回复用户结果
Expand Down Expand Up @@ -89,7 +89,7 @@ public function index() {
* @return string
*/
public function paramGet($param) {
return "Your name: {$param["name"]}";
return "Hello, ".$param["name"];
}

/**
Expand Down

0 comments on commit 5386662

Please sign in to comment.