第一步禁用缓存...完成...
下面是我的文件层次结构:
这是我的 config.xml 在 app/code/community/Foggyline/HappyHour/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Foggyline_HappyHour>
<version>1.0.0.0</version>
</Foggyline_HappyHour>
</modules>
<frontend>
<routers>
<foggyline_happyhour>
<use>standard</use>
<args>
<module>Foggyline_HappyHour</module>
<frontName>happyhour</frontName>
</args>
</foggyline_happyhour>
</routers>
</frontend>
<global>
<blocks>
<foggyline_happyhour>
<class>Foggyline_HappyHour_Block</class>
</foggyline_happyhour>
</blocks>
<models>
<foggyline_happyhour>
<class>Foggyline_HappyHour_Model</class>
<resourceModel>foggyline_happyhour_resource</resourceModel>
</foggyline_happyhour>
<foggyline_happyhour_resource>
<class>Foggyline_HappyHour_Model_Resource</class>
<entities>
<user>
<table>foggyline_happyhour_user</table>
</user>
</entities>
</foggyline_happyhour_resource>
</models>
<resources>
<foggyline_happyhour_setup>
<setup>
<model>Foggyline_HappyHour</model>
</setup>
<connection>
<use>core_setup</use>
</connection>
<foggyline_happyhour_write>
<connection>
<use>core_write</use>
</connection>
</foggyline_happyhour_write>
<foggyline_happyhour_read>
<connection>
<use>core_read</use>
</connection>
</foggyline_happyhour_read>
</foggyline_happyhour_setup>
</resources>
</global>
</config>
我的安装脚本位于 app/code/community/Foggyline/HappyHour/sql/foggyline_happyhour_setup/install-1.0.0.0.php
还尝试将 install-1.0.0.0.php
重命名为 mysql4-install-1.0.0.0.php
但没有工作..
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$table = $installer->getConnection()
->newTable($installer->getTable('foggyline_happyhour/user'))
->addColumn('user_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
'identify' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true)
, 'Id')
->addColumn('first_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
'nullable' => false
)
, 'First Name')
->addColumn('last_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
'nullable' => false
)
, 'Last Name')
->setComment('Foggyline_HappyHour User Entity');
$installer->getConnection()->createTable($table);
$installer->endSetup();
现在当我刷新我的商店或访问我商店的任何页面时..没有任何东西进入 mysql..core_resource
表没有任何条目作为 foggyline_happyhour_setup 版本 1.0.0.0
,我也尝试清除缓存 /var/cache
任何帮助或建议将是一个很大的帮助提前感谢...
我是 magento 的新手..并且仍在学习它..这样我就可以成为一名 magento 开发人员...
最佳答案
请为资源添加读写权限。
<resources>
<foggyline_happyhour_setup>
<setup>
<module>Foggyline_HappyHour</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</foggyline_happyhour_setup>
<foggyline_happyhour_write>
<connection>
<use>core_write</use>
</connection>
</foggyline_happyhour_write>
<foggyline_happyhour_read>
<connection>
<use>core_read</use>
</connection>
</foggyline_happyhour_read>
现在需要从core_resource中移除资源条目,然后移除缓存并尝试检查。
关于php - 安装脚本不工作 magento 1.9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25862013/