非SQL模块设置脚本(Magento) [英] Non-SQL module setup script (Magento)

查看:108
本文介绍了非SQL模块设置脚本(Magento)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个模块来安装一些内容,例如,在安装模块时将一些静态块添加到CMS部分(我知道该怎么做).

I'd like a module to install some content, for instance add some static blocks to the CMS section when the module is installed (I know how to do this).

只有PHP和Magento的东西,不需要直接使用SQL,不需要数据库表,诸如此类.

It'd only be PHP and Magento stuff, there's no direct need for SQL, no database table, nothing like that.

因此,一个通用的PHP脚本可以正确配置Magento,但仅在该特定模块的安装或升级过程中才可以.

So a generic PHP script that configures Magento the right way, but only during installs or upgrades of that particular module.

我知道我可以为此使用安装程序资源mysql4-install-#.#.#.php脚本方法,但这简直是错误的.

I know I could use the Setup Resource mysql4-install-#.#.#.php script method for this, but that just feels plain wrong.

有什么想法吗?

推荐答案

这是一种适当的用法-如果要添加或更新CMS,则正在使用数据库.实际上,这就是

This is an appropriate usage - you are working with the database if you are adding or updating CMS. In fact, it's how the initial homepage fixture data is implemented.

请注意,在CE> = 1.6和EE> = 1.11中,应使用完整的DDL:

Note that in CE >= 1.6 and EE >= 1.11 there is a complete DDL which should be used: ALTER TABLE in Magento setup script without using SQL

这篇关于非SQL模块设置脚本(Magento)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆