emlog-app-dev — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited emlog-app-dev (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
此 Skill 旨在协助您开发 Emlog 应用,包括插件 (Plugin) 和主题 (Theme/Template)。它包含最新的开发规范、目录结构、接口文档及最佳实践。
根据用户的开发目标,可以快速查阅以下更详细的参考文档:
所有 PHP 文件头部必须包含以下安全检查,防止被直接运行:
defined('EMLOG_ROOT') || exit('access denied!'); if(!defined('EMLOG_ROOT')) {exit('error!');}插件位于 content/plugins/<plugin_alias>/ 目录下:
<plugin_alias>.php:核心主文件。包含插件元数据(Header)和钩子注册。<plugin_alias>_callback.php:生命周期回调。定义激活(callback_init)、更新(callback_up)、删除(callback_rm)时的逻辑。<plugin_alias>_setting.php:后台设置页。包含 plugin_setting_view 函数。<plugin_alias>_show.php:前台独立页面构建。preview.jpg:预览图(75x75 像素,JPG格式)。my_tool_func),防止冲突。callback_rm)务必清理所有自建数据(如使用 Storage::getInstance('plugin_alias')->deleteAllName('YES'))。/**
* 插件激活回调函数:用于在插件激活时初始化数据
* @return void
*/
function callback_init() {
$storage = Storage::getInstance('my_plugin');
$storage->setValue('status', 'active');
}
/**
* 插件卸载回调函数:用于在插件卸载时清理所有数据,保持系统干净
* @return void
*/
function callback_rm() {
$storage = Storage::getInstance('my_plugin');
$storage->deleteAllName('YES');
}使用 addAction('hook_name', 'function_name') 注册。
adm_head, adm_footer, adm_main_top, save_log (参数: $blogid, $pubPost, $logData), del_log (参数: $blogid), adm_writelog_head, adm_writelog_sideindex_head, index_footer, log_related (参数: $logData), comment_post, comment_saved模板位于 content/templates/<template_alias>/ 目录下:
header.php:站点头部信息(包含 head 信息、顶部标题、导航栏,开头必须包含模板信息注释)log_list.php:首页/列表页(展示文章列表)echo_log.php:文章详情页(展示单篇文章内容)footer.php:站点底部信息page.php:自定义页面(非必须)module.php:功能模块(定义侧边栏组件、自定义函数等,非必须)options.php:模板设置(后台选项,非必须)preview.jpg:预览图(500x300 像素,JPG格式)在模板中引入其他组件时,必须使用系统自带的 View::getView 方法:
require_once View::getView('header');
require_once View::getView('side');
require_once View::getView('footer');BLOG_URL (站点首页 URL), TEMPLATE_URL (当前模板文件夹 URL)$value['logid'], $value['log_title'], $value['log_url'], $value['log_cover']$logid, $log_title, $log_content, $date插件和主题开发均可使用以下核心类与全局方法:
禁止使用 $_GET / $_POST / $_REQUEST,防止 SQL 注入。
// 获取 POST 提交的字符型变量,默认值为空
$str = Input::postStrVar('name', '');
// 获取 GET 提交的整型变量,默认值为 0
$int = Input::getIntVar('id', 0);
// 获取 POST 提交的整型数组,例如 ids[]
$ids = Input::postIntArray('ids');主要用于插件接口或 AJAX 交互,避免直接 echo json_encode(...)。
// 输出操作成功带回数据并终止脚本
Output::ok(['id' => 1]);
// 输出操作失败提示信息并终止脚本
Output::error('Permission denied');使用 Storage 类存储键值对,禁止使用写文件的方式保存配置。
// 获取插件专属的 Storage 单例
$storage = Storage::getInstance('my_plugin_or_theme');
// 保存配置项的值
$storage->setValue('key', 'value');
// 读取配置项的值
$val = $storage->getValue('key');smartDate($timestamp) -> 返回 "1分钟前" 等subContent($content, 180, 1) -> 截取180字并过滤HTML标签getFirstImage($content) -> 获取内容首张图片 URLemMsg($msg) -> 输出友好提示,支持 HTML~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.