<?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);
}
}
}在application.ini中加入 [development : production] resources.zfdebug.enabled = 1
以上就是将ZFDebug加入到ZF的项目中的内容,更多相关内容请关注PHP中文网(www.php.cn)!
目前,PetShop已经从最初的2.0、3.0等版本,发展到了最新的4.0版本。PetShop 4.0使用ASP.NET 2.0技术开发,其中加入了众多新增特性,因此,在性能、代码数量、可扩展性等方面有了重大改善。可以说,学习PetShop 4.0是深入掌握ASP.NET 2.0技术的捷径。本节将引领读者逐步了解PetShop 4.0的方方面面,包括应用程序安装、功能和用户界面简介、解决方案和体系
0
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号