maltyxx / debugbar
v1.0.3
2016-07-29 14:32 UTC
Requires
- php: >=5.3.0
- composer/installers: 1.0.*
- maximebf/debugbar: ^1.0.0
This package is auto-updated.
Last update: 2020-11-10 16:04:19 UTC
README
Codeigniter 3 调试栏
要求
- PHP 5.3.x (Composer 要求)
- CodeIgniter 3.0.x
安装
步骤 1 使用 Composer 安装
运行 composer
composer require maltyxx/debugbar
步骤 2 配置
编辑文件 ./application/config/config.php
将 $config['composer_autoload'] = FALSE;
修改为 $config['composer_autoload'] = FCPATH.'vendor/autoload.php';
复制配置文件 ./application/third_party/debugbar/config/profiler.php
到 ./application/config/profiler.php
。
步骤 3 创建文件
在 /application/controllers/Debug.php
中创建控制器文件。
<?php defined('BASEPATH') OR exit('No direct script access allowed'); require(APPPATH.'/third_party/debugbar/controllers/Debug.php');
步骤 4 示例
控制器文件位于 ./application/core/MY_Controller.php
。
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class MY_Controller extends CI_Controller { public function __construct() { parent::__construct(); $this->load->add_package_path(APPPATH.'third_party/debugbar'); $this->load->library('console'); $this->output->enable_profiler(TRUE); $this->console->debug('Hello world !'); } }