2013-01-14 55 views
1

我的安裝程序腳本無法運行。Magento 1.7 - 安裝程序腳本不運行

/app/etc/modules/Starmall_Salesorder.xml

<?xml version="1.0"?> 
<config> 
<modules> 
    <Starmall_Salesorder> 
     <active>true</active> 
     <version>0.1.0</version> 
     <codePool>local</codePool> 
    </Starmall_Salesorder> 
</modules> 

的Config.xml

<modules> 
    <Starmall_Salesorder> 
     <version>0.1.0</version> 
    </Starmall_Salesorder> 
</modules> 

... 
    <resources> 
     <starmall_salesorder_setup> 
      <setup> 
       <module>Starmall_Salesorder</module> 
      </setup> 
     </starmall_salesorder_setup> 
    </resources> 

... 

/應用程序/代碼/本地/ Starmall/Salesorder/SQL/starmall_salesorder_setup/mysql4-install-0.1.0.php:

<?php echo 'Running installer: '.get_class($this)."\n <br /> \n"; 
die("Exit for now"); 

加載頁面時,我看不到測試輸出。
此模塊的core_resource中沒有行。

沒有錯誤,看看在/ var /日誌

爲什麼這個安裝程序無法運行?

我加入調試線app/code/core/Mage/Core/Model/Resource/Setup.php
它沒有得到這裏的這個功能_installResourceDb($newVersion)

protected function _installResourceDb($newVersion) 
{ 
    Mage::log("this line is not added to log file"); 

    $oldVersion = $this->_modifyResourceDb(self::TYPE_DB_INSTALL, '', $newVersion); 
    $this->_modifyResourceDb(self::TYPE_DB_UPGRADE, $oldVersion, $newVersion); 
    $this->_getResource()->setDbVersion($this->_resourceName, $newVersion); 

    return $this; 
} 
+0

1)驗證配置緩存被禁用或至少它被清除。 2)發佈模塊的聲明文件(位於* app/etc/modules/*中)。 – benmarks

+0

我已經添加了我的'/ app/etc/modules/Starmall_Salesorder.xml'我禁用了緩存並刪除了以確保/ var文件夾 – Guus

回答

1

假設你有一個modules節點匹配您的文章模塊聲明文件,而且你是一個區分大小寫的文件系統,那麼應用程序不會加載你的模塊配置文件。

當Magento正在初始化時,<modules>的子節點與codePool值一起用作每個模塊配置文件路徑的一部分。節點名稱(例如starmall_salesorder)被轉換爲目錄路徑Starmall/Salesorder(注意大小寫)。要解決此問題,請在聲明和配置文件中將模塊的節點名稱更正爲Starmall_Salesorder,並將值更改爲global/resources/starmall_salesorder_setup/setup/module以匹配。

一個進一步的注意:在Magento CE 1.6和更高的模型層返工是數據庫無關的,所以它對於用於1.6+新模塊使用安裝的文件名,如安裝-1.0.php爲是適當後端不可知的升級腳本。

+0

再次檢查,您是對的!缺少大寫字母。 – Guus

0

今天我也遇到了一些麻煩。即使它被禁用,我也必須清除緩存。因此,無論何時更新/更改/運行安裝程序腳本,請確保先手動清除緩存。

相關問題