【问题标题】:Joomla Install/Uninstall SQL FIles Location in a PackageJoomla 安装/卸载包中的 SQL 文件位置
【发布时间】:2013-05-08 09:38:14
【问题描述】:

我正在构建一个包含一个组件、多个模块和一个插件的 Joomla 包。

我的问题是,相对于包根目录,我应该将 install.sql 和 uninstall.sql 文件放在哪里?现在它们位于root/com_mypackage/administrator/sql/install.mysql.utf8.sql,它们在组件的清单中定义为:

<install><!-- Runs on install -->
    <sql>
      <file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
    </sql>
</install>

但是,这对我来说似乎不对。我应该在&lt;file&gt; 标记中的路径之前包含administrator 吗?

当然,组件本身会打包在自己的 .zip 中,以包含在 Package 的 XML 安装文件中。

【问题讨论】:

    标签: joomla joomla-extensions


    【解决方案1】:

    不需要管理员标签中的这个标签。你在 manifest.xml 中遗漏了一些 对于完整的文档尝试:-

    http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2.5/Adding_an_install-uninstall-update_script_file

    http://docs.joomla.org/Components:xml_installfile

    在我的最后 manifest.xml(我在 admin/install/install.mysql.utf8 中的 .sql):-

    <?xml version="1.0" encoding="utf-8"?>
    <extension type="component" version="2.5" method="upgrade">
        <name>Social</name>
        <license>Open Source License, GPL v2 based</license>
        <author>me</author>
        <authorEmail>developers@me.com</authorEmail>
        <authorUrl>http://www.me.com</authorUrl>
        <creationDate>2012-01-01</creationDate>
        <copyright>2013, me</copyright>
        <version>1.1</version>
        <description></description>
    
        <!-- Installation -->   
    
        <install>
            <sql>
                <file driver="mysql" charset="utf8">install/install.mysql.utf8.sql</file>
            </sql>
        </install>
        <installfile>install/install.php</installfile>
        <uninstall>
            <sql>
                <file driver="mysql" charset="utf8">install/uninstall.mysql.utf8.sql</file>
            </sql>
        </uninstall>
        <uninstallfile>install/uninstall.php</uninstallfile>
    

    和其余的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-20
      • 2012-02-04
      • 2021-10-17
      • 1970-01-01
      • 2017-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多