【问题标题】:How to update joomla modules from repository?如何从存储库更新 joomla 模块?
【发布时间】:2014-02-24 15:07:42
【问题描述】:

我创建了模块并将其放入 joomla 存储库。我为该模块创建了更新,并将其也放入存储库。在我的 xml 文件中,我写了一些要安装标签的行:

 <install version="1.5" type="module" client="site" method="upgrade">

我知道如何在 joomla 中更新扩展 (Update extentions)

<extension type="component" version="2.5.0" method="upgrade">

但是如何更新模块呢?在管理部分,我无法从存储库中看到我的更新。你能帮我吗,或者你能给我一些链接,我可以在其中阅读有关 Joomla 中仅模块更新的信息。

谢谢!

【问题讨论】:

  • 您是否添加了&lt;update&gt; 标签并将其链接到您的外部XML 文件?
  • 不,我没有这样做,你能写个简单的例子吗?
  • 告诉我应该在我的模块中插入 <extension type="component" version="2.5.0" method="upgrade"></extension> 吗?因为模块它不是扩展。或者我需要写一些 <extension type="module" version="2.5.0" method="upgrade"></extension>

标签: joomla joomla-extensions


【解决方案1】:

您首先需要将以下内容添加到您的模块的 XML 文件中:

<updateservers>
    <server type="extension" name="Name of Module" priority="1">http://www.example.com/update.xml</server>
</updateservers>

然后,创建一个名为 update.xml 的新 XML 文件(如果您想将其命名为其他名称,请务必更改上面代码中的名称)并将以下代码添加到其中:

<updates>
    <update>
       <name>Name of Module</name>
       <description>description goes here</description>
       <element>mod_my_module</element>
       <type>module</type>
       <version>1.0.0</version>
       <downloads>
           <downloadurl type="full" format="zip">http://www.example.com/module.zip</downloadurl>
       </downloads>
       <maintainer>Company Name</maintainer>
       <maintainerurl>http://www.example.com</maintainerurl>
       <targetplatform name="joomla" version="2.5"/>
       <client>0</client>
       <client_id>0</client_id>
    </update>
<updates>

每次您想要发布更新时,您只需复制&lt;update&gt; 标签和其中的所有内容,并将其放在前一个标签之上。所以这里将是版本 1.0.01.1.0

的示例
<updates>
    <update>
       <name>Name of Module</name>
       <description>description goes here</description>
       <element>mod_my_module</element>
       <type>module</type>
       <version>1.1.0</version>
       <downloads>
           <downloadurl type="full" format="zip">http://www.example.com/module.zip</downloadurl>
       </downloads>
       <maintainer>Company Name</maintainer>
       <maintainerurl>http://www.example.com</maintainerurl>
       <targetplatform name="joomla" version="2.5"/>
       <client>0</client>
       <client_id>0</client_id>
    </update>
    <update>
       <name>Name of Module</name>
       <description>description goes here</description>
       <element>mod_my_module</element>
       <type>module</type>
       <version>1.0.0</version>
       <downloads>
           <downloadurl type="full" format="zip">http://www.example.com/module.zip</downloadurl>
       </downloads>
       <maintainer>Company Name</maintainer>
       <maintainerurl>http://www.example.com</maintainerurl>
       <targetplatform name="joomla" version="2.5"/>
       <client>0</client>
       <client_id>0</client_id>
    </update>
<updates>

希望对你有帮助

【讨论】:

  • 简单又完美!非常感谢;-)
  • 它是否适用于本地服务器?我尝试使用 joomla 3.0 将它实现到我的本地主机中的模块,但 joomla 永远无法识别更新
  • 它在使用 Wampserver 的本地服务器上运行良好。我不确定 Xampp,因为我拒绝使用它,所以您需要检查您的 localhost 设置以允许这样的传出请求
  • @Lodder 我试图安装你的一个模块,JJ Social Image,它使用更新程序,我在 Joomla 2.5 上收到了这条消息:更新::扩展:无法打开 joomjunk.co.uk/updates/socialimages_update.xml 但 JCE 工作美好的。见dropbox.com/s/yaxos8hqd3nymnz/65ita.jpg?dl=0。在 Joomla 3.3 中什么也没发生(没有识别出更新)
  • @Lodder fyi 我没有旧版本的 JJ Social 图片,所以我在本地主机上的 xml 文件中更改了 JJ Social 图片版本,以使其识别更新
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-08-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-29
  • 2015-08-28
相关资源
最近更新 更多