Skip to content

Commit ac6f656

Browse files
committed
v5.5
1 parent 892791a commit ac6f656

File tree

8 files changed

+218
-170
lines changed

8 files changed

+218
-170
lines changed

src/addons/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(App $app)
5858
$this->action = $this->request->action();
5959
$this->addon = $this->addon ? call_user_func($filter, $this->addon) : app()->http->getName();
6060
$this->addon_path = $app->addons->getAddonsPath() . $this->addon;
61-
$this->controller = $controller ? call_user_func($filter, $controller) : 'index';
61+
$this->controller = $this->controller ? call_user_func($filter, $this->controller) : 'index';
6262
$this->action = $this->action ? call_user_func($filter, $this->action) : 'index';
6363
// 父类的调用必须放在设置模板路径之后
6464
$this->_initialize();

src/addons/Service.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ private function loadEvent()
178178
$values = (array)$values;
179179
}
180180
$hooks[$key] = array_filter(array_map(function ($v) use ($key) {
181-
return [get_addons_class($v),$key];
181+
$addon = get_addons_class($v);
182+
return $addon?[$addon,$key]:[];
182183
}, $values));
183184
}
184185
Cache::set('hooks', $hooks);
@@ -192,7 +193,6 @@ private function loadEvent()
192193
}
193194
}
194195

195-
196196
/**
197197
* 自动载入钩子插件
198198
* @return bool

src/builder/FormBuilder.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,16 @@ public function closebtn($reset = true, $options = [])
504504
return $this;
505505
}
506506

507-
507+
/**
508+
* @param bool $reset
509+
* @param array $options
510+
* @return string
511+
*/
512+
public function close($reset = true, $options = [])
513+
{
514+
$this->formHtml[] = Form::closebtn($reset,$options);
515+
return $this;
516+
}
508517
/**
509518
* @param bool $reset
510519
* @param array $options
@@ -559,8 +568,8 @@ public function script(string $name,$options=[]){
559568
*/
560569
public function extrajs($js,$options=[]){
561570
$reg = '/<script.*?>([\s\S]*?)<\/script>/im';
562-
preg_match($reg, $script,$match);
563-
$this->extraJs = empty($match)?$script:$match[1];
571+
preg_match($reg, $js,$match);
572+
$this->extraJs = empty($match)?$js:$match[1];
564573
return $this;
565574
}
566575
public function style(string $name,$options=[]){

src/curd/Install.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 版权所有 2017-2028 FunAdmin,并保留所有权利。
66
* 网站地址: https://www.FunAdmin.com
77
* ----------------------------------------------------------------------------
8-
* 采用最新Thinkphp6实现
8+
* 采用最新Thinkphp8实现
99
* ============================================================================
1010
* Author: yuege
1111
* Date: 2020/9/21
@@ -30,7 +30,7 @@ class Install extends Command
3030
//sql 文件
3131
protected $sqlFile = '';
3232
//mysql版本
33-
protected $mysqlVersion = '5.6';
33+
protected $mysqlVersion = '5.7';
3434
//database模板
3535
protected $databaseTpl = '';
3636

@@ -160,10 +160,11 @@ protected function install($input): void{
160160
$db["username"] = $env['DATABASE']['USERNAME'] ;
161161
$db["password"] = $env['DATABASE']['PASSWORD'] ;
162162
}
163+
$prefix = env('DB_PREFIX');
163164
$db["host"] = strtolower($this->output->ask($this->input, '👉 Set mysql hostname default(127.0.01)'))?:$db["host"];
164165
$db["port"] = strtolower($this->output->ask($this->input, '👉 Set mysql hostport default (3306)'))?:$db["port"] ;
165166
$db['database'] = strtolower($this->output->ask($this->input, '👉 Set mysql database default (funadmin)'))?:$db["database"];
166-
$db['prefix'] = strtolower($this->output->ask($this->input, '👉 Set mysql table prefix default (fun_)'))?:$db["prefix"];
167+
$db['prefix'] = strtolower($this->output->ask($this->input, "👉 Set mysql table prefix default( $prefix )"))?:$db["prefix"];
167168
$db["charset"] = strtolower($this->output->ask($this->input, '👉 Set mysql table charset default (utf8mb4)'))?:$db["charset"];
168169
$db['username'] = strtolower($this->output->ask($this->input, '👉 Set mysql username default (root)'))?:$db["username"];
169170
$db['password'] = strtolower($this->output->ask($this->input, '👉 Set mysql password required'))?: $db["password"];

src/curd/service/CurdService.php

Lines changed: 104 additions & 99 deletions
Large diffs are not rendered by default.

src/curd/tpl/addon/plugin.tpl

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,4 @@ class Plugin extends Addons
4646
{
4747
return true;
4848
}
49-
50-
/**
51-
* 实现初始化钩子方法
52-
* @return mixed
53-
*/
54-
public function AddonsInit($param)
55-
{
56-
57-
}
58-
59-
/**
60-
* 实现化钩子方法
61-
* @return mixed
62-
*/
63-
public function demoHook($param)
64-
{
65-
return true;
66-
}
67-
6849
}

src/curd/tpl/join.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public function {{$joinName}}()
1+
public function {{$joinName}}()
22
{
33
return $this->{{$joinMethod}}('{{$joinModel}}','{{$joinForeignKey}}','{{$joinPrimaryKey}}');
44
}

0 commit comments

Comments
 (0)