我正在开发一个magento模块,我试图通过我的脚本在数据库中安装一个表但由于某些原因我无法运行此安装脚本。
这是我的config.xml
代码:
<?xml version="1.0"?>
<config>
<!-- turn on our module, required for install support -->
<modules>
<Gwb_Magecrmsync>
<version>0.1.0</version>
</Gwb_Magecrmsync>
</modules>
<frontend>
<routers>
<magecrmsync>
<use>standard</use>
<args>
<module>Gwb_Magecrmsync</module>
<frontName>magecrmsync</frontName>
</args>
</magecrmsync>
</routers>
<layout>
<updates>
<magecrmsync>
<file>adminhtml.xml</file>
</magecrmsync>
</updates>
</layout>
</frontend>
<admin>
<routers>
<magecrmsync>
<use>admin</use>
<args>
<module>Gwb_Magecrmsync</module>
<frontName>magecrmsync</frontName>
</args>
</magecrmsync>
</routers>
</admin>
<adminhtml>
<menu>
<menu1 translate="title" module="magecrmsync">
<title>Synchronize</title>
<sort_order>999</sort_order>
<children>
<menuitem1 module="magecrmsync">
<title>Customers</title>
<action>magecrmsync/adminhtml_customers</action>
</menuitem1>
<menuitem2 module="magecrmsync">
<title>Orders</title>
<action>magecrmsync/adminhtml_orders</action>
</menuitem2>
<menuitem3 module="magecrmsync">
<title>Products</title>
<action>magecrmsync/adminhtml_products</action>
</menuitem3>
</children>
</menu1>
</menu>
<acl>
<resources>
<admin>
<children>
<menu1 translate="title" module="magecrmsync">
<title>Synchronize</title>
<sort_order>999</sort_order>
<children>
<menuitem1>
<title>Customers</title>
</menuitem1>
<menuitem2>
<title>Orders</title>
</menuitem2>
<menuitem3>
<title>Products</title>
</menuitem3>
</children>
</menu1>
</children>
</admin>
</resources>
</acl>
</adminhtml>
<global>
<!-- turn on models -->
<models>
<magecrmsync>
<class>Gwb_Magecrmsync_Model</class>
<resourceModel>Magecrmsync_mysql4</resourceModel>
</magecrmsync>
<magecrmsync_mysql4>
<class>Gwb_Magecrmsync_Model_Mysql4</class>
<entities>
<magecrmsync>
<table>magecrmsync</table>
</magecrmsync>
</entities>
</magecrmsync_mysql4>
</models>
<!-- turn on models -->
<!-- turn on database connections -->
<resources>
<!-- setup is needed for automatic installation -->
<magecrmsync_setup>
<setup>
<module>Gwb_Magecrmsync</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</magecrmsync_setup>
<magecrmsync_write>
<connection>
<use>core_write</use>
</connection>
</magecrmsync_write>
<magecrmsync_read>
<connection>
<use>core_read</use>
</connection>
</magecrmsync_read>
</resources>
<blocks>
<magecrmsync>
<class>Gwb_Magecrmsync_Block</class>
</magecrmsync>
</blocks>
<helpers>
<magecrmsync>
<class>Gwb_Magecrmsync_Helper</class>
</magecrmsync>
</helpers>
<layout>
<magecrmsync>
<file>adminhtml.xml</file>
</magecrmsync>
</layout>
</global>
</config>
这是mysql4-install-0.1.0.php
Gwb/Magecrmsync/sql/magecrmsync_setup
文件
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('magecrmsync')};
CREATE TABLE {$this->getTable('magecrmsync')} (
`user_id` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL),
PRIMARY KEY (`user_id`)
ENGINE = MyISAM DEFAULT CHARSET=utf8;
");
$installer->endSetup();
有谁能告诉我,我在这里做错了什么不让我的安装脚本执行?
任何帮助都将受到赞赏,对我有所帮助。