Skip to content

Commit

Permalink
v5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin committed Mar 16, 2024
1 parent 892791a commit ac6f656
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 170 deletions.
2 changes: 1 addition & 1 deletion src/addons/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(App $app)
$this->action = $this->request->action();
$this->addon = $this->addon ? call_user_func($filter, $this->addon) : app()->http->getName();
$this->addon_path = $app->addons->getAddonsPath() . $this->addon;
$this->controller = $controller ? call_user_func($filter, $controller) : 'index';
$this->controller = $this->controller ? call_user_func($filter, $this->controller) : 'index';
$this->action = $this->action ? call_user_func($filter, $this->action) : 'index';
// 父类的调用必须放在设置模板路径之后
$this->_initialize();
Expand Down
4 changes: 2 additions & 2 deletions src/addons/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ private function loadEvent()
$values = (array)$values;
}
$hooks[$key] = array_filter(array_map(function ($v) use ($key) {
return [get_addons_class($v),$key];
$addon = get_addons_class($v);
return $addon?[$addon,$key]:[];
}, $values));
}
Cache::set('hooks', $hooks);
Expand All @@ -192,7 +193,6 @@ private function loadEvent()
}
}


/**
* 自动载入钩子插件
* @return bool
Expand Down
15 changes: 12 additions & 3 deletions src/builder/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,16 @@ public function closebtn($reset = true, $options = [])
return $this;
}


/**
* @param bool $reset
* @param array $options
* @return string
*/
public function close($reset = true, $options = [])
{
$this->formHtml[] = Form::closebtn($reset,$options);
return $this;
}
/**
* @param bool $reset
* @param array $options
Expand Down Expand Up @@ -559,8 +568,8 @@ public function script(string $name,$options=[]){
*/
public function extrajs($js,$options=[]){
$reg = '/<script.*?>([\s\S]*?)<\/script>/im';
preg_match($reg, $script,$match);
$this->extraJs = empty($match)?$script:$match[1];
preg_match($reg, $js,$match);
$this->extraJs = empty($match)?$js:$match[1];
return $this;
}
public function style(string $name,$options=[]){
Expand Down
7 changes: 4 additions & 3 deletions src/curd/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 版权所有 2017-2028 FunAdmin,并保留所有权利。
* 网站地址: https://www.FunAdmin.com
* ----------------------------------------------------------------------------
* 采用最新Thinkphp6实现
* 采用最新Thinkphp8实现
* ============================================================================
* Author: yuege
* Date: 2020/9/21
Expand All @@ -30,7 +30,7 @@ class Install extends Command
//sql 文件
protected $sqlFile = '';
//mysql版本
protected $mysqlVersion = '5.6';
protected $mysqlVersion = '5.7';
//database模板
protected $databaseTpl = '';

Expand Down Expand Up @@ -160,10 +160,11 @@ protected function install($input): void{
$db["username"] = $env['DATABASE']['USERNAME'] ;
$db["password"] = $env['DATABASE']['PASSWORD'] ;
}
$prefix = env('DB_PREFIX');
$db["host"] = strtolower($this->output->ask($this->input, '👉 Set mysql hostname default(127.0.01)'))?:$db["host"];
$db["port"] = strtolower($this->output->ask($this->input, '👉 Set mysql hostport default (3306)'))?:$db["port"] ;
$db['database'] = strtolower($this->output->ask($this->input, '👉 Set mysql database default (funadmin)'))?:$db["database"];
$db['prefix'] = strtolower($this->output->ask($this->input, '👉 Set mysql table prefix default (fun_)'))?:$db["prefix"];
$db['prefix'] = strtolower($this->output->ask($this->input, "👉 Set mysql table prefix default( $prefix )"))?:$db["prefix"];
$db["charset"] = strtolower($this->output->ask($this->input, '👉 Set mysql table charset default (utf8mb4)'))?:$db["charset"];
$db['username'] = strtolower($this->output->ask($this->input, '👉 Set mysql username default (root)'))?:$db["username"];
$db['password'] = strtolower($this->output->ask($this->input, '👉 Set mysql password required'))?: $db["password"];
Expand Down
203 changes: 104 additions & 99 deletions src/curd/service/CurdService.php

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions src/curd/tpl/addon/plugin.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,4 @@ class Plugin extends Addons
{
return true;
}

/**
* 实现初始化钩子方法
* @return mixed
*/
public function AddonsInit($param)
{
}

/**
* 实现化钩子方法
* @return mixed
*/
public function demoHook($param)
{
return true;
}

}
2 changes: 1 addition & 1 deletion src/curd/tpl/join.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public function {{$joinName}}()
public function {{$joinName}}()
{
return $this->{{$joinMethod}}('{{$joinModel}}','{{$joinForeignKey}}','{{$joinPrimaryKey}}');
}
Loading

0 comments on commit ac6f656

Please sign in to comment.