首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Magento无法识别自定义sql设置

Magento无法识别自定义sql设置
EN

Stack Overflow用户
提问于 2013-06-03 22:51:12
回答 1查看 160关注 0票数 0

我无法让magento执行我的sql设置。我以前这样做过,没有问题,但是这个应用程序有它自己的想法,因为它现在不想这么做。这就是我到目前为止所做的。

app/code/local/Namespace/Module/etc/config.xml

代码语言:javascript
复制
<config>
    <modules>
        <namespace_module>
            <version>0.0.1</version>
        </namespace_module>
    </modules>
    <global>
        <resources>
            <module_setup>
                <setup>
                    <module>Namespace_Module</module>
                    <class>Namespace_Module_Model_Resource_Setup</class>
                </setup>
            </module_setup>
        </resources>
    </global>
</config>

app/code/local/Namespace/Module/Model/Resource/Setup.php

代码语言:javascript
复制
<?php
class Namespace_Module_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup {


}

app/code/local/Namespace/Module/sql/module_setup/mysql4-install-0.0.1.php

代码语言:javascript
复制
<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition License
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magentocommerce.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Mage
 * @package     Mage_Catalog
 * @copyright   Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license     http://www.magentocommerce.com/license/enterprise-edition
 */

$installer = $this;
/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */

$installer->startSetup();

if (!$installer->tableExists($installer->getTable('namespace_module_table'))) {
    $installer->run("
    create table namespace_module_table (
        postal_code char(5) primary key,
        north_east_bound_lat varchar(64),
        north_east_bound_lng,
        namespace_module_address varchar(64),
        time_zone_id varchar(30)
    );
    ");
}

$installer->endSetup();

因此,我能够让magento识别我的Setup.php文件,因为它在某一点上抛出了错误,但我修复了它。但是当我检查core_resources时,我看不到我的模块设置。

我禁用了所有缓存,并刷新了洋红缓存和存储式缓存。并禁用和启用了我的app/etc/modules/Namespace_Module.xml

请记住,这个模块是全功能的,它只是没有一个安装程序,这是我试图做的。我只是给了你安装这个东西的最低要求。

EN

回答 1

Stack Overflow用户

发布于 2013-06-04 00:07:45

弄清楚了..。

代码语言:javascript
复制
<config>
    <modules>
        <namespace_module>
            <version>0.0.1</version>
        </namespace_module>
    </modules>
</config>

需要..。

代码语言:javascript
复制
<config>
    <modules>
        <Namespace_Module>
            <version>0.0.1</version>
        </Namespace_Module>
    </modules>
</config>

您的模块命名空间和模块名称需要与模块命名空间和模块名称目录结构匹配。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16899590

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档