php - 您将如何测试表达式引擎中的模块是否有错误?

标签 php testing module expressionengine

我已经为 expressionengine 制作了一个模块,但我不知道应该如何测试它是否有错误,所以我尝试安装它。但是它没有安装也没有返回任何错误,只是刷新了页面。有人知道怎么做吗?

我的文件是这样的:

第三方 > 上传图片:

  • 语言 > 英语 > upload_pictures_lang.php
  • View > 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;
}
}

最佳答案

你有关注ExpressionEngine Module Development Tutorial吗?在开发者文档中?

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

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

ExpressionEngine's Control Panel Output and Debugging Preferences :
CP Home > Admin > 系统管理 > 输出和调试

ExpressionEngine Output and Debugging Preferences

关于php - 您将如何测试表达式引擎中的模块是否有错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6525174/

相关文章:

php - 非英语地址的 Google map API 问题 (PHP/CURL)

java - 使用 Firebase 在 Android Studio 中进行 JUnit 测试

haskell - GHC API - 如何使用 GHC 7.2 从已编译模块中动态加载 Haskell 代码?

javascript - 使用 babel 避免 "default"属性间接

php - 在开头截断字符串

PHPUnit - PHP fatal error : Call to a member function GetOne() on null

php - 无法使用此命令安装 oro 平台 sudo php app/console oro :install --env ="dev"

testing - 本地、测试和生产版本控制

php - 在 Yii2 中禁用功能和验收测试

maven - 如何使用嵌套模块打包多模块 maven 项目