您如何在expressionengine中测试模块中的错误?

时间:2011-06-29 18:01:32

标签: php testing module expressionengine

我已经为expressionengine创建了一个模块,但我不知道我应该如何测试它的错误,所以我尝试安装它。但它没有安装并且没有返回任何错误,只是刷新了页面。有谁知道怎么样?

我拥有的文件是这样的:

third_party> upload_pictures:

  • 语言>英语> upload_pictures_lang.php
  • views>的index.php
  • mcp.upload_pictures.php
  • mod.upload_pictures.php
  • tab.upload_pictures.php
  • upd.upload_pictures.php

和安装程序代码

class Upload_pictures_upd
{
var $version='1.0';

function Upload_pictures_upd()
{
    $this->EE=& get_instance();
}

function install()
{
    $this->EE->load->dbforge();

    $data=array(
        'module_name'       =>'Picture uploader',
        'module_version'    =>$this->version,
        'has_cp_backend'    =>'y',
        'has_publish_fields'=>'y'
    );

    $this->EE->db->insert('modules',$data);

    $data=array(
        'class' =>'upload_pictures',
        'method'=>'run'
    );

    $this->EE->db->insert('actions',$data);

    $this->EE->load->library('layout');
    $this->EE->layout->add_layout_tabs($this->tabs(),'module_name');
    return true;
}

function update($current='')
{
    if ($current==$this->version)
    {
        return false;
    }
    elseif ($current<2.0)
    {
        //nothin
    }
    return true;
}

function uninstall()
{
    $this->EE->load->library("layout");
    $this->EE->layout->delete_layout_tabs($this->tabs(),'upload_pictures');
    return true;
}

function tabs()
{
    $tabs['upload pictures']=array(
        'upload_pictures_ids'=>array(
            'visible'       =>'true',
            'collapse'      =>'false',
            'htmlbuttons'   =>'false',
            'width'         =>'100%'
        )
    );
    return $tabs;
}
}

1 个答案:

答案 0 :(得分:3)

您是否关注了开发人员文档中的ExpressionEngine Module Development Tutorial

如果您无法安装模块,则可能缺少一个或多个所需的功能或文件。文件的命名和位置也非常重要。

如果您怀疑错误,请启用输出分析器或模板调试器(见下文)并检查Apache或PHP的error_log

ExpressionEngine's Control Panel Output and Debugging Preferences
CP Home&gt;管理员&gt;系统管理&gt;输出和调试

ExpressionEngine Output and Debugging Preferences