PHP Console工具使用分享

2021-10-17 14:06:28 字數 2021 閱讀 3867

php console:

php console工具和firephp功能相似,提供以下功能:

handle php errors, dump variables, execute php code remotely in google chrome

首先在chrome中安裝php console外掛程式:

其次在php**中引入php console庫,然後呼叫輸出相應除錯資訊:

如下例index2.php:

<?php  require_once(__dir__ . '/../src/phpconsole/__autoload.php'); // call debug from phpconsole\handler$handler = phpconsole\handler::getinstance();$handler->start();$handler->debug('called from handler debug', 'some.three.tags'); $array = array('test' => 1,'test2' => 1,'key' => array(1, 2, 3, 4,),  );$handler->debug($array, 'test.wiki.wade.zhan');
輸出除錯資訊到控制台,如下圖:

php console工具通過將除錯資訊輸出到http響應頭php-console,然後php console外掛程式分析響應頭php-console字串輸出相應除錯資訊。

php console提供了通過密碼來保護除錯資訊的功能,如下例,在伺服器端設定密碼:

<?php  require_once(__dir__ . '/../src/phpconsole/__autoload.php'); $password = 'test';$connector = phpconsole\connector::getinstance();$connector->setpassword($password); // call debug from phpconsole\handler$handler = phpconsole\handler::getinstance();$handler->start();$handler->debug('called from handler debug', 'some.three.tags'); $array = array('test' => 1,'test2' => 1,'key' => array(1, 2, 3, 4,),  );$handler->debug($array, 'test.wiki.wade.zhan');
此時可以看到只有當客戶端輸入正確的密碼:

此時響應頭部才會輸出相應的除錯資訊:

工具使用 docker使用

0x01 docker介紹 docker 是 paas 提供商 dotcloud 開源的乙個基於 lxc 的高階容器引擎,源 託管在 github 上,基於go語言並遵從apache2.0協議開源,docker 是乙個開源的應用容器引擎,讓開發者可以打包他們的應用以及依賴包到乙個可移植的映象中,然後...

使用Ant工具

使用 ant工具步驟如下 1.新建乙個資料夾 myspring 該資料夾將作為當前專案的根資料夾。2.在 myspring 資料夾下新建資料夾 src,該資料夾下存放專案原始檔。3.在 myspring 資料夾下新建 classes 該資料夾下存放專案編譯後的類檔案。4.在 myspring 下新建...

AndroidADB工具使用

adb androiddebugbridge 是android提供的乙個通用除錯工具,借助這個工具,我媽可以管理裝置或手機模 擬器的狀態。adb功能操作 快速更新裝置或手機模擬器中的 如應用或android系統公升級 在裝置上執行shell命令 管理裝置或手機模擬器上預定埠 在裝置或手機模擬器上覆制...