在Joomla 1.5和1.6上扩展清单文件中指定的install.sql文件的用法有什么不同。
在1.5版本中,如果您使用method="upgrade“,并且组件已经安装,则会执行install.sql。
在2.5版本中,如果您使用method="upgrade“并且组件已经安装,则不会执行install.sql。
有没有人知道这一改变是否是故意的?
发布于 2012-11-09 17:31:40
这是经过深思熟虑的,因为从1.6开始,sql现在有一个更新标记:
//executed when component is installed for the first time
<install folder="admin">
<sql>
<file driver="mysql" charset="utf8">sql/example.install.sql</file>
</sql>
</install>
//executed when component is uninstalled
<uninstall folder="admin">
<sql>
<file driver="mysql" charset="utf8">sql/example.uninstall.sql</file>
</sql>
</uninstall>
//executed when the component is installed over an existing version
//or updated through the Joomla Update Manager
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>有关这方面的更多信息,请参阅manifest.xml structure here上的Joomla1.6Wikipage
https://stackoverflow.com/questions/13283029
复制相似问题