PHP code example of ryunosuke / php-web-debugger

1. Go to this page and download the library: Download ryunosuke/php-web-debugger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ryunosuke / php-web-debugger example snippets


$debugger = new \ryunosuke\WebDebugger\Debugger([
    /** ひっかけるレスポンスヘッダー */
    'rewrite'      => [
        'content-type 正規表現' => fn($contents) => "書き換えたコンテンツ",
    ],
    /** bool PRG パターンの抑止フラグ */
    'stopprg'      => true,
    /** string ひっかけるパス */
    'hookpath'     => 'webdebugger-action',
    /** string 無視するパス */
    'ignore'       => '#\.(ico|map)$#',
    /** string リクエストファイル置き場 */
    'workdir'      => sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'wd-working',
    /** string パスを開く URL */
    'opener'       => 'http://localhost:9090',
    'opener_query' => 'project=X&remote=true',
]);
$debugger->initialize([
    \ryunosuke\WebDebugger\Module\Ajax::class        => [/* 固有のモジュールオプション */],
    \ryunosuke\WebDebugger\Module\Error::class       => [/* 固有のモジュールオプション */],
    \ryunosuke\WebDebugger\Module\Server::class      => [/* 固有のモジュールオプション */],
    \ryunosuke\WebDebugger\Module\Performance::class => [/* 固有のモジュールオプション */],
    \ryunosuke\WebDebugger\Module\Log::class         => [/* 固有のモジュールオプション */],
])->start();

$debugger->initialize([
    \ryunosuke\WebDebugger\Module\Doctrine::getInstance('Master')->initialize(['connection' => $masterConnection]),
    \ryunosuke\WebDebugger\Module\Doctrine::getInstance('Slave')->initialize(['connection' => $slaveConnection]),
])->start();
json
{
    "yunosuke/php-web-debugger": "dev-master"
    }
}