<?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); } } }
2. [PHP]代码
在application.ini中加入 [development : production] resources.zfdebug.enabled = 1
以上就是将ZFDebug加入到ZF的项目中的内容,更多相关内容请关注PHP中文网(www.php.cn)!
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章
刺客信条阴影:贝壳谜语解决方案
3 周前ByDDD
Windows 11 KB5054979中的新功能以及如何解决更新问题
2 周前ByDDD
在哪里可以找到原子中的起重机控制钥匙卡
3 周前ByDDD
<🎜>:死铁路 - 如何完成所有挑战
4 周前ByDDD
Atomfall指南:项目位置,任务指南和技巧
4 周前ByDDD

热工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

Atom编辑器mac版下载
最流行的的开源编辑器

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。