Skip to content

Instantly share code, notes, and snippets.

@gh640
Created February 6, 2016 12:47
Show Gist options
  • Select an option

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

Select an option

Save gh640/114e4fff6f5dbe2e08bb to your computer and use it in GitHub Desktop.
PHP: エラーハンドラを whoops に差し替える auto_prepend_file ファイル
<?php
/**
* すべての PHP プロセスの前に whoops を呼び出す
*
* php.ini 内で次のようにセットされています
* auto_prepend_file = "/path/to/set_whoops.php"
*
* セットアップ手順:
* 1. whoops をインストール `$ composer global require 'filp/whoops'`
* 2. 本ファイルを作成
* 3. php.ini に auto_prepend_file の行を追加
*
* @see https://filp.github.io/whoops/
*/
require_once '/path/to/composer/vendor/autoload.php';
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment