跳过到主要内容
版本: 5.1

安装

开发者注意

不建议创建直接包含加载并启动 CMS 框架的脚本,并且只在极少数情况下需要。根据用例,您应该创建 控制台插件 并扩展 Joomla! 控制台应用程序。如果您需要为 Web 请求创建简单的入口点,请编写 ajax 插件.

安装您的自定义脚本

如果您有权访问 Web 应用程序的文件系统,那么您当然可以将脚本复制到您选择的文件夹中。

如果您想以通常的方式安装脚本,则必须在清单文件中使用“file”作为扩展类型,例如。

<?xml version="1.0" encoding="utf-8"?>
<extension type="file" version="5.1" method="upgrade">
<name>Custom Script</name>
<version>1.0</version>
<description>Script to count the number of articles in the database</description>
<fileset>
<files target="cli">
<filename>myscript.php</filename>
</files>
</fileset>
</extension>

安装它将导致脚本“myscript.php”被放入 Joomla cli 目录。