线上购物.不能运行安装脚本


magento .. can't run install script

我试图为我的模块运行安装脚本,这是我第一次,但它没有运行,我可以在core_resource表中找到我的模块。模块版本为:

<Mdg_Gift>
    <version>0.1.0</version>
 </Mdg_Gift>

和安装程序名称是:

mysql4-install-0.1.0.php

我在app/code/core/Mage/core/Model/Resource/Setup.php中找到了这个代码区域

$resModel   = (string)$this->_connectionConfig->model;
$modName    = (string)$this->_moduleConfig[0]->getName();
$filesDir   = Mage::getModuleDir('sql', $modName) . DS . $this->_resourceName;
 if (!is_dir($filesDir) || !is_readable($filesDir)) {
 return array();
 }

,打印出$filesDir,其值为:

G: ' XAMPP ' XAMPP '根'柑橘' app ' ' '目标代码' ' sql '礼物mdg_gift_setup

路径错误,缺少本地代码池,我不知道该怎么办。如有任何帮助,我将不胜感激。

Config.xml文件是:

<?xml version="1.0"?>
<config>
    <modules>
        <Mdg_Gift>
            <version>0.1.0</version>
        </Mdg_Gift>
    </modules>
    <global>
        <models>
            <mdg_gift>
                <class>Mdg_Gift_Model</class>
                <resourceModel>mdg_gift_mysql4</resourceModel>
            </mdg_gift>
            <mdg_gift_mysql4>
                <class>Mdg_Gift_Model_Mysql4</class>
                <entities>
                    <entity>
                        <table>mdg_gift_entity</table>
                    </entity>
                    <item>
                        <table>mdg_gift_item</table>
                    </item>
                    <type>
                        <table>mdg_gift_type</table>
                    </type>
                </entities>
            </mdg_gift_mysql4>
        </models>
        <blocks>
            <mdg_gift>
                <class>Mdg_Gift_Block</class>
            </mdg_gift>
        </blocks>
        <helpers>
            <mdg_gift>
                <class>Mdg_Gift_Helper</class>
            </mdg_gift>
        </helpers>
        <resources>
            <mdg_gift_setup>
                <setup>
                    <module>Mdg_Gift</module>
                    <class>Mdg_Gift_Model_Resource_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </mdg_gift_setup>
            <mdg_gift_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </mdg_gift_write>
            <mdg_gift_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </mdg_gift_read>
        </resources>
    </global>
    <frontend>
        <routers>
            <mdg_gift>
                <use>standard</use>
                <args>
                    <module>Mdg_Gift</module>
                    <frontName>gift</frontName>
                </args>
            </mdg_gift>
        </routers>
    </frontend>
</config>

我也不能路由到IndexController.php文件,我的代码中有任何错误这里是我的IndexController.php文件:

<?php
class Mdg_Gift_IndexController extends Mage_Core_Controller_Front_Action{
    public function indexAction()
    {
        echo 'This is our test controller';
    }
}

/app/etc/模块/Mdg_Gift.xml:

<config>
    <modules>
        <mdg_gift>
            <active>true</active>
            <codePool>local</codePool>
        </mdg_gift>
    </modules>
</config>

在etc/modules中使用大写的模块名,即

<config>
    <modules>
        <Mdg_Gift>
            <active>true</active>
            <codePool>local</codePool>
        </Mdg_Gift>
    </modules>
</config>