【发布时间】:2011-01-17 20:28:05
【问题描述】:
我正在尝试为我的扩展程序创建一个安装脚本,但由于某种原因它不会是安装脚本。扩展将显示在 core_resource 表中,但我尝试创建的属性不会创建。
我很确定脚本甚至没有被调用,因为我在开头放了一个 exit() 并且网站运行得很好。
这是我的配置 XML 文件中的内容。这被放置在全局 -> 资源路径中:
<nie_setup>
<setup>
<module>Nie_Nie</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</nie_setup>
我的安装脚本如下:
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$setup->addAttribute('customer', 'nie_admin', array(
'input' => 'text',
'type' => 'text',
'backend' => '',
'visible' => 0,
'required' => 0,
'user_defined' => 1,
));
$installer->endSetup();
我在这里遗漏了什么明显的东西是脚本无法运行的原因吗?
【问题讨论】:
-
请公布安装脚本的位置
-
/app/code/local/Nie/Nie/sql/nie_setup/mysql4-install-0.0.1.php
-
确保
中模块名称的大小写与资源配置中的 大小写相同。我自己也遇到了这个问题。
标签: php magento attributes installation