Files
addons
cron
controller
model
view
Cron.php
config.php
install.sql
uninstall.sql
dysms
kuaidi
.htaccess
app_download_files
extend
hyhproject
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
hyhproject.tar.gz
index.html
index.php
reg.lock
robots.txt
qlg.tsgz.moe/addons/cron/Cron.php
2019-09-06 23:53:10 +08:00

76 lines
1.6 KiB
PHP
Executable File

<?php
namespace addons\cron; // 注意命名空间规范
use think\addons\Addons;
use addons\cron\model\Crons as DM;
/**
* 计划任务功能
* @author HSF
*/
class Cron extends Addons{
// 该插件的基础信息
public $info = [
'name' => 'Cron', // 插件标识
'title' => '计划任务', // 插件名称
'description' => '计划任务管理,若用户没有在系统里配置定时任务则建议开启该插件', // 插件简介
'status' => 0, // 状态
'author' => 'HSF',
'version' => '1.0.0'
];
/**
* 插件安装方法
* @return bool
*/
public function install(){
$m = new DM();
$flag = $m->install();
WSTClearHookCache();
return $flag;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall(){
$m = new DM();
$flag = $m->uninstall();
WSTClearHookCache();
return $flag;
}
/**
* 插件启用方法
* @return bool
*/
public function enable(){
WSTClearHookCache();
return true;
}
/**
* 插件禁用方法
* @return bool
*/
public function disable(){
WSTClearHookCache();
return true;
}
/**
* 插件设置方法
* @return bool
*/
public function saveConfig(){
WSTClearHookCache();
return true;
}
public function initCronHook($params){
echo "<img style='display:none' src='".request()->root(true)."/addon/cron-cron-runCrons.html'>";
}
}