PHP code example of shiki / yii-firephp

1. Go to this page and download the library: Download shiki/yii-firephp 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/ */

    

shiki / yii-firephp example snippets


  ....

  'log' => array(
    'class' => 'CLogRouter',
    'routes' => array(
      // the default (file logger)
      array(
        'class' => 'CFileLogRoute',
        'levels' => 'error, warning',
      ),
      // standard log route
      array(
        'class' => '\\SK\\Yii\\FirePHP\\LogRoute',
        'levels' => 'error, warning, info, trace',
      ),
      // profile log route
      array(
        'class' => '\\SK\\Yii\\FirePHP\\ProfileLogRoute',
        'report' => 'summary', // or "callstack"
      ),
    ),
  ),

  ....
  

// logging an INFO message
Yii::log('This is an info message.', CLogger::LEVEL_INFO);

// logging a WARNING message
Yii::log("You didn't setup a profile, are you really a person?", CLogger::LEVEL_WARNING);

// logging with a CATEGORY (categories are displayed as "labels" in FirePHP -- just an additional info text)
Yii::log('Profile successfully created', CLogger::LEVEL_INFO, 'application.user.profiles');

// tracing simple text
Yii::trace('Loading application.user.profiles.ninja', 'application.user.profiles');

// logging an ERROR
Yii::log('We have successfully determined that you are not a person',
  CLogger::LEVEL_ERROR, 'Any category/label will work');

// If you need to log an array, you can use FirePHP's core methods
FB::warn(array('a' => 'b', 'c' => 'd'), 'an.array.warning');

Yii::beginProfile('a somewhat slow method');

...
// some function calls here
// more function calls

Yii::beginProfile('nested profile');
// you can also nest profile calls
Yii::endProfile('nested profile');

Yii::endProfile('a somewhat slow method'); // end