Skip to content

Instantly share code, notes, and snippets.

@gh640
Created February 6, 2016 08:27
Show Gist options
  • Select an option

  • Save gh640/cfb0143f4ab1d6bb73c0 to your computer and use it in GitHub Desktop.

Select an option

Save gh640/cfb0143f4ab1d6bb73c0 to your computer and use it in GitHub Desktop.
Drupal 7 での ChromePHP の使い方

Drupal での ChromePHP の使い方

1. セットアップ

  1. ChromeLogger をインストール
  1. ChromePhp.php ダウンロードして PHP include パスのどこかに入れる
$ wget https://raw.githubusercontent.com/ccampbell/chromephp/master/ChromePhp.php
$ php -r 'echo get_include_path();'

2. 利用

変数を出力したい場所で Chromephp クラスの log メソッドを呼び出す。

<?php
include 'ChromePhp.php';
ChromePhp::log('Hello console!');
ChromePhp::log($_SERVER);

Devel モジュールが提供する ChromePhp::log のラッパ dcp() を使うと便利。

<?php
dcp('You are seeing what you must not see...');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment