mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
ComposerUpdarte
This commit is contained in:
parent
006dd93b8d
commit
c714a7ab2d
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -401,12 +401,12 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||||
"reference": "10b94d3b9dc3b0bea5e5c759b7f00a3fc057280b"
|
"reference": "df2aa0872d2da7d3b37dd76f0816500c15280626"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/10b94d3b9dc3b0bea5e5c759b7f00a3fc057280b",
|
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/df2aa0872d2da7d3b37dd76f0816500c15280626",
|
||||||
"reference": "10b94d3b9dc3b0bea5e5c759b7f00a3fc057280b",
|
"reference": "df2aa0872d2da7d3b37dd76f0816500c15280626",
|
||||||
"shasum": "",
|
"shasum": "",
|
||||||
"mirrors": [
|
"mirrors": [
|
||||||
{
|
{
|
||||||
@ -426,7 +426,7 @@
|
|||||||
"qiniu/php-sdk": "^7.2",
|
"qiniu/php-sdk": "^7.2",
|
||||||
"topthink/framework": "5.1.*"
|
"topthink/framework": "5.1.*"
|
||||||
},
|
},
|
||||||
"time": "2019-11-26T02:19:03+00:00",
|
"time": "2019-11-27T12:45:33+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -72,7 +72,22 @@ abstract class Controller extends \stdClass
|
|||||||
if (in_array($this->request->action(), get_class_methods(__CLASS__))) {
|
if (in_array($this->request->action(), get_class_methods(__CLASS__))) {
|
||||||
$this->error('Access without permission.');
|
$this->error('Access without permission.');
|
||||||
}
|
}
|
||||||
|
// 初始化控制器
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
// 控制器后置操作
|
||||||
|
if (method_exists($this, $method = "_{$this->request->action()}_{$this->request->method()}")) {
|
||||||
|
$this->app->hook->add('app_end', function (\think\Response $response) use ($method) {
|
||||||
|
try {
|
||||||
|
[ob_start(), ob_clean()];
|
||||||
|
call_user_func_array([$this, $method], $this->request->route());
|
||||||
|
} catch (HttpResponseException $exception) {
|
||||||
|
$end = $exception->getResponse();
|
||||||
|
$response->code($end->getCode())->header($end->getHeader())->content($response->getContent() . $end->getContent());
|
||||||
|
} catch (\Exception $exception) {
|
||||||
|
throw $exception;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,22 +99,6 @@ abstract class Controller extends \stdClass
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Controller destruct
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
|
||||||
public function __destruct()
|
|
||||||
{
|
|
||||||
$method = "_{$this->request->action()}_{$this->request->method()}";
|
|
||||||
if (method_exists($this, $method)) try {
|
|
||||||
call_user_func_array([$this, $method], $this->request->route());
|
|
||||||
} catch (HttpResponseException $exception) {
|
|
||||||
$exception->getResponse()->send();
|
|
||||||
} catch (\Exception $exception) {
|
|
||||||
throw $exception;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回失败的操作
|
* 返回失败的操作
|
||||||
* @param mixed $info 消息内容
|
* @param mixed $info 消息内容
|
||||||
|
@ -35,13 +35,13 @@ class DeleteHelper extends Helper
|
|||||||
* 数据对象主键名称
|
* 数据对象主键名称
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $pkField;
|
protected $field;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据对象主键值
|
* 数据对象主键值
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $pkValue;
|
protected $value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 逻辑器初始化
|
* 逻辑器初始化
|
||||||
@ -56,11 +56,11 @@ class DeleteHelper extends Helper
|
|||||||
{
|
{
|
||||||
$this->where = $where;
|
$this->where = $where;
|
||||||
$this->query = $this->buildQuery($dbQuery);
|
$this->query = $this->buildQuery($dbQuery);
|
||||||
$this->pkField = empty($field) ? $this->query->getPk() : $field;
|
$this->field = empty($field) ? $this->query->getPk() : $field;
|
||||||
$this->pkValue = $this->app->request->post($this->pkField, null);
|
$this->value = $this->app->request->post($this->field, null);
|
||||||
// 主键限制处理
|
// 主键限制处理
|
||||||
if (!isset($this->where[$this->pkField]) && is_string($this->pkValue)) {
|
if (!isset($this->where[$this->field]) && is_string($this->value)) {
|
||||||
$this->query->whereIn($this->pkField, explode(',', $this->pkValue));
|
$this->query->whereIn($this->field, explode(',', $this->value));
|
||||||
}
|
}
|
||||||
// 前置回调处理
|
// 前置回调处理
|
||||||
if (false === $this->controller->callback('_delete_filter', $this->query, $where)) {
|
if (false === $this->controller->callback('_delete_filter', $this->query, $where)) {
|
||||||
|
@ -53,7 +53,7 @@ class AuthService extends Service
|
|||||||
if (empty($nodes[$real]['isauth'])) {
|
if (empty($nodes[$real]['isauth'])) {
|
||||||
return empty($nodes[$real]['islogin']) ? true : $this->isLogin();
|
return empty($nodes[$real]['islogin']) ? true : $this->isLogin();
|
||||||
} else {
|
} else {
|
||||||
return in_array($real, $this->app->session->get('user.nodes'));
|
return in_array($real, (array)$this->app->session->get('user.nodes'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,10 +53,9 @@ class ProcessService extends Service
|
|||||||
public function create($command)
|
public function create($command)
|
||||||
{
|
{
|
||||||
if ($this->iswin()) {
|
if ($this->iswin()) {
|
||||||
$command = __DIR__ . "/bin/console.exe {$command}";
|
$this->exec(__DIR__ . "/bin/console.exe {$command}");
|
||||||
pclose(popen("wmic process call create \"{$command}\"", 'r'));
|
|
||||||
} else {
|
} else {
|
||||||
pclose(popen("{$command} &", 'r'));
|
$this->exec("{$command} &");
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -70,14 +69,14 @@ class ProcessService extends Service
|
|||||||
{
|
{
|
||||||
$list = [];
|
$list = [];
|
||||||
if ($this->iswin()) {
|
if ($this->iswin()) {
|
||||||
$result = $this->exec('wmic process where name="php.exe" get processid,CommandLine');
|
$lines = $this->exec('wmic process where name="php.exe" get processid,CommandLine', true);
|
||||||
foreach (explode("\n", $result) as $line) if ($this->_issub($line, $command) !== false) {
|
foreach ($lines as $line) if ($this->_issub($line, $command) !== false) {
|
||||||
$attr = explode(' ', $this->_space($line));
|
$attr = explode(' ', $this->_space($line));
|
||||||
$list[] = ['pid' => array_pop($attr), 'cmd' => join(' ', $attr)];
|
$list[] = ['pid' => array_pop($attr), 'cmd' => join(' ', $attr)];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$result = $this->exec("ps ax|grep -v grep|grep \"{$command}\"");
|
$lines = $this->exec("ps ax|grep -v grep|grep \"{$command}\"", true);
|
||||||
foreach (explode("\n", $result) as $line) if ($this->_issub($line, $command) !== false) {
|
foreach ($lines as $line) if ($this->_issub($line, $command) !== false) {
|
||||||
$attr = explode(' ', $this->_space($line));
|
$attr = explode(' ', $this->_space($line));
|
||||||
list($pid) = [array_shift($attr), array_shift($attr), array_shift($attr), array_shift($attr)];
|
list($pid) = [array_shift($attr), array_shift($attr), array_shift($attr), array_shift($attr)];
|
||||||
$list[] = ['pid' => $pid, 'cmd' => join(' ', $attr)];
|
$list[] = ['pid' => $pid, 'cmd' => join(' ', $attr)];
|
||||||
@ -104,11 +103,13 @@ class ProcessService extends Service
|
|||||||
/**
|
/**
|
||||||
* 立即执行指令
|
* 立即执行指令
|
||||||
* @param string $command 执行指令
|
* @param string $command 执行指令
|
||||||
* @return string
|
* @param boolean $outarr 返回类型
|
||||||
|
* @return string|array
|
||||||
*/
|
*/
|
||||||
public function exec($command)
|
public function exec($command, $outarr = false)
|
||||||
{
|
{
|
||||||
return shell_exec($command);
|
exec($command, $output);
|
||||||
|
return $outarr ? $output : join("\n", $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user