Table of Contents
将ZFDebug加入到ZF的项目中
<?php /** * ZFDebug resource * * @copyright Copyright (c) 2011 Ricky Feng (http://code.google.com/p/rphp4zf) * @license New BSD License */ class RPHP_Application_Resource_ZFDebug extends Zend_Application_Resource_ResourceAbstract { public function init() { //get ini file options $iniOptions = $this->getOptions(); //set ZFDebug to autoload $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader -> registerNamespace('ZFDebug'); //initialized Front Controller $bootstrap = $this->getBootstrap(); $bootstrap->bootstrap('frontController'); $frontController = $bootstrap->getResource('frontController'); if ($iniOptions['enabled'] && 'development' == APPLICATION_ENV) { //set ZFDebug options $options = array( 'jquery_path' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', 'plugins' => array( 'Variables', 'File' => array('basePath' => APPLICATION_PATH .'/..'), 'Memory', 'Time', 'Registry', 'Exception' ), ); //add cache option if specified if($bootstrap->hasPluginResource('cache')){ $bootstrap->bootstrap('cache'); $cache = $bootstrap->getPluginResource('cache')->getBackend(); $options['plugins']['Cache']['backend'] = $cache; } // add db option if specified if ($bootstrap->hasPluginResource('db')) { $bootstrap->bootstrap('db'); $db = $bootstrap->getPluginResource('db')->getDbAdapter(); $options['plugins']['Database']['adapter'] = $db; } $debug = new ZFDebug_Controller_Plugin_Debug($options); $frontController->registerPlugin($debug); } } }
Copy after login
2. [PHP]代码
在application.ini中加入 [development : production] resources.zfdebug.enabled = 1
Copy after login
以上就是将ZFDebug加入到ZF的项目中的内容,更多相关内容请关注PHP中文网(www.php.cn)!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article
Assassin's Creed Shadows: Seashell Riddle Solution
1 months ago
By DDD
What's New in Windows 11 KB5054979 & How to Fix Update Issues
3 weeks ago
By DDD
Where to find the Crane Control Keycard in Atomfall
1 months ago
By DDD
How to fix KB5055523 fails to install in Windows 11?
2 weeks ago
By DDD
InZoi: How To Apply To School And University
3 weeks ago
By DDD

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
