<?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脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
1 週前ByDDD
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
在哪裡可以找到原子中的起重機控制鑰匙卡
1 週前ByDDD

熱工具

SublimeText3漢化版
中文版,非常好用

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

Atom編輯器mac版下載
最受歡迎的的開源編輯器

記事本++7.3.1
好用且免費的程式碼編輯器

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),