开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 3

小程序开发/PHPCMS V10 修改版

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (1)
master
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
项目仓库所选许可证以仓库主分支所使用许可证为准
master
分支 (1)
master
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (1)
master
phpcms
/
cms
/
modules
/
admin
/
module.php
phpcms
/
cms
/
modules
/
admin
/
module.php
module.php 3.80 KB
一键复制 编辑 原始数据 按行查看 历史
找寻知音 提交于 2024年10月02日 18:00 +08:00 . 初始化仓库
<?php
defined('IN_CMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
class module extends admin {
private $input,$cache_api,$db,$module;
public function __construct() {
$this->input = pc_base::load_sys_class('input');
$this->cache_api = pc_base::load_app_class('cache_api', 'admin');
$this->db = pc_base::load_model('module_model');
parent::__construct();
}
public function init() {
$show_header = true;
$dirs = $module = $dirs_arr = $directory = array();
$dirs = glob(PC_PATH.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'*');
foreach ($dirs as $d) {
if (is_dir($d)) {
$d = basename($d);
$dirs_arr[] = $d;
}
}
define('INSTALL', true);
$modules = $this->db->select('', '*', '', '', '', 'module');
foreach ($modules as $dir => $path) {
if (is_file(PC_PATH.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php')) {
$cfg = require PC_PATH.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php';
if ($author) {
$modules[$dir]['author'] = $author;
}
if ($version) {
$modules[$dir]['version'] = $version;
}
}
}
$directory = $dirs_arr;
include $this->admin_tpl('module_list');
}
/**
* 模块安装
*/
public function install() {
$this->module = $this->input->post('module') ? $this->input->post('module') : dr_json(0, L('illegal_parameters'));
$module_api = pc_base::load_app_class('module_api');
if (!$module_api->check($this->module)) dr_json(0, $module_api->error_msg);
if ($module_api->install()) {
$this->cache();
dr_json(1, L('success_module_install'), '');
} else {
dr_json(0, $module_api->error_msg);
}
}
/**
* 模块卸载
*/
public function uninstall() {
$this->module = $this->input->post('module') ? $this->input->post('module') : dr_json(0, L('illegal_parameters'));
$module_api = pc_base::load_app_class('module_api');
if(!$module_api->uninstall($this->module)) {
dr_json(0, $module_api->error_msg);
} else {
$this->cache();
dr_json(1, L('uninstall_success'), '');
}
}
/**
* 更新模块缓存
*/
public function cache() {
$modules = array(
array('function' => 'module'),
array('mod' => 'admin', 'file' => 'sites', 'function' => 'set_cache'),
array('function' => 'category'),
array('function' => 'downservers'),
array('function' => 'badword'),
array('function' => 'ipbanned'),
array('function' => 'keylink'),
array('function' => 'position'),
array('function' => 'admin_role'),
array('function' => 'urlrule'),
array('function' => 'sitemodel'),
array('function' => 'type', 'param' => 'content'),
array('function' => 'workflow'),
array('function' => 'dbsource'),
array('function' => 'member_setting'),
array('function' => 'member_group'),
array('function' => 'membermodel'),
array('function' => 'member_model_field'),
array('function' => 'type', 'param' => 'search'),
array('function' => 'search_setting'),
array('function' => 'vote_setting'),
array('function' => 'link_setting'),
array('function' => 'special'),
array('function' => 'setting'),
array('function' => 'database'),
array('mod' => 'formguide', 'file' => 'formguide', 'function' => 'public_cache'),
array('function' => 'copyfrom'),
array('function' => 'del_file'),
array('function' => 'attachment_remote'),
);
foreach ($modules as $m) {
if ($m['mod'] && $m['function']) {
if ($m['file'] == '') $m['file'] = $m['function'];
$M = getcache('modules', 'commons');
if (in_array($m['mod'], array_keys($M))) {
$cache = pc_base::load_app_class($m['file'], $m['mod']);
$cache->{$m['function']}();
}
} else {
$this->cache_api->cache($m['function'], $m['param']);
}
}
}
}
?>
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

PHPCMS V10 修改版 QQ、微信:297885395 QQ讨论群:551419699
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/exphp/phpcms.git
git@gitee.com:exphp/phpcms.git
exphp
phpcms
PHPCMS V10 修改版
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /