Zfdebug

ZFDebugは、Zend Frameworkのプラグインです。 各ページの下部にある小さなパネルに有用なデバッグ情報が含まれています。 バージョン1.5より前は、Scienta ZF Debug Barと呼ばれていました。

画像

時間、メモリ、データベースクエリの数が一目でわかります。 さらに、処理された(含まれた)ファイルに関する情報、使用可能な変数テンプレート(ビュー)およびSQLクエリのリストが別のパネルに表示されます(図では、データベースは2つのアダプターで構成されています)。

既存のプラグイン


インストールと使用


include_pathで指定されたディレクトリにZFDebugディレクトリを配置します。 次に、次のメソッドを追加してクラスをロードします(ZF 1.8 +):

protected function _initZFDebug()
{
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace( 'ZFDebug' );

$options = array(
'plugins' => array( 'Variables' ,
'Database' => array( 'adapter' => $db),
'File' => array( 'basePath' => '/path/to/project' ),
'Memory' ,
'Time' ,
'Registry' ,
'Cache' => array( 'backend' => $cache->getBackend()),
'Exception' )
);
$debug = new ZFDebug_Controller_Plugin_Debug($options);

$ this ->bootstrap( 'frontController' );
$frontController = $ this ->getResource( 'frontController' );
$frontController->registerPlugin($debug);
}

* This source code was highlighted with Source Code Highlighter .


プロジェクトページで詳細をご覧ください: zfdebug.googlecode.com

Source: https://habr.com/ru/post/J62023/


All Articles