我正尝试使用自定义模块创建自定义表。我一直在关注Alan Storm's article创建一个自定义表Magento安装脚本永远不会运行
这是我的文件夹结构
CM
Tablecreation
etc >> config.xml (has 1.6.0.0 as the version mentioned)
Helper >> Data.php
controllers >> IndexController.php
Model
Actualtable.php
Mysql4
Actualtable.php
Resource
Mysql4
Setup.php
sql
tablecreation_setup
install-1.6.0.0.php
这是我的config.xml文件。
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<CM_Tablecreation>
<version>1.6.0.0</version>
</CM_Tablecreation>
</modules>
<frontend>
<routers>
<tablecreation>
<use>standard</use>
<args>
<module>CM_Tablecreation</module>
<frontName>tablecreation</frontName>
</args>
</tablecreation>
</routers>
</frontend>
<global>
<models>
<tablecreation>
<class>CM_Tablecreation_Model</class>
<resourceModel>tablecreation_mysql4</resourceModel>
</tablecreation>
<tablecreation_mysql4>
<class>CM_Tablecreation_Model_Mysql4</class>
<entities>
<actualtable>
<table>actual_table</table>
</actualtable>
</entities>
</tablecreation_mysql4>
</models>
<resources>
<tablecreation_setup>
<setup>
<module>CM_Tablecreation</module>
<class>CM_Tablecreation_Model_Resource_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</tablecreation_setup>
<tablecreation_write>
<connection>
<use>core_write</use>
</connection>
</tablecreation_write>
<tablecreation_read>
<connection>
<use>core_read</use>
</connection>
</tablecreation_read>
</resources>
<helpers>
<tablecreation>
<class>CM_Tablecreation_Helper</class>
</tablecreation>
</helpers>
</global>
</config>
这是我得到的每一个
a:5:{i:0;s:69:"/home/dev/public_html/app/code///sql/tablecreation_setup not found";i:1;s:818:"#0 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.0')
我通过把尝试捕捉与应用程序/代码/核心/法师/核心/资源/ Setup.php作为异常消息试过调试时间错误在这个主题的一些以前的类似问题中提出,但没有成功
我的模块甚至没有列入core_resource表中。即使一些事情如此,表格肯定也不会被创建。
我也有这种情况时,它确实在core_resource表中列出,但如果我从表中删除我的模块的记录(再次运行安装脚本),然后尝试刷新我的网站的任何页面,我再次得到错误页面打开我发现同样的错误的报告。
基本上,我在网上的任何文章,我都被卡在这个相同的错误。请帮我解释一下这个错误以及导致它的原因。如果有人能够提出解决问题的方法,那么也许也是如此。
许多在此先感谢。
将您的config.xml粘贴到这里 –