【问题标题】:Magento module working local but not on serverMagento 模块在本地工作但不在服务器上
【发布时间】:2016-05-17 03:21:45
【问题描述】:

我为 Magento 1.9.x 编写了一个自定义模块。 本地它工作得很好,但它没有被加载到服务器上......看起来模块没有加载。

我想覆盖客户的 AccountController 和来自客户的 Helper/Data。

任何人都可以在文件中找到错误吗?谢谢!

我已经清除了 magento 和 /var/cache 中的缓存,但没有任何效果

这是我的文件:

/app/etc/modules/Org_RestLogin.xml

<?xml version="1.0"?> 
<config>
    <modules>
         <Org_RestLogin>
              <active>true</active> 
              <codePool>local</codePool> 
              <depends>
                  <Mage_Customer /> <!-- Make sure, this is loaded first -->
              </depends>
         </Org_RestLogin>
    </modules>
 </config>

/app/code/local/org/RestLogin/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Org_RestLogin>
            <version>1.1.1</version>
        </Org_RestLogin>
    </modules>

    <frontend>
        <routers>
            <customer>
                <args>
                    <modules>
                        <org_restlogin before="Mage_Customer">Org_RestLogin</org_restlogin>
                    </modules>
                </args>
            </customer>
        </routers>
    </frontend>

    <global>
       <helpers>
          <customer>
              <rewrite>
                  <data>Org_RestLogin_Customer_Helper_Data</data>
             </rewrite>
          </customer>
       </helpers>
    </global>
</config>

/app/code/local/org/RestLogin/controllers/AccountController.php

<?php
require_once 'Mage/Customer/controllers/AccountController.php';

class Org_RestLogin_AccountController extends Mage_Customer_AccountController {
    //my custom methods
}

/app/code/local/org/RestLogin/Customer/Helper/Data.php

<?php
class Org_RestLogin_Customer_Helper_Data extends Mage_Customer_Helper_Data
{
    /**
     * Check whether customers registration is allowed
     *
     * @return bool
     */
    public function isRegistrationAllowed() {
        return false;
    }
}

【问题讨论】:

  • 实时服务器上是否设置了任何文件权限?您是否检查过您的模块是否显示在管理部分?
  • 在管理部分显示模块。文件权限也正确
  • 您的本地服务器和实时服务器使用相同的 magento 版本吗?
  • 他们使用相同的magento版本:1.9.2.3
  • 编译模式是禁用还是启用?

标签: php magento magento-1.9 magento-dev


【解决方案1】:

我找到了解决方案。 这是文件夹中的错字...“org”应该是“Org”

【讨论】:

    猜你喜欢
    • 2012-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多