예제 #1
0
파일: debug.php 프로젝트: pdelbar/onethree
 protected static function getDebugger()
 {
     if (is_null(self::$debugger)) {
         header('x-insight: inspect');
         $_SERVER['x-insight'] = 'inspect';
         set_include_path(ONE_LIB_PATH . '/../vendor/firephp/' . PATH_SEPARATOR . get_include_path());
         define('INSIGHT_CONFIG_PATH', self::getConfigFile());
         require_once 'FirePHP/Init.php';
         self::$debugger = FirePHP::getInstance(true);
         self::$debugger->setEnabled(true);
     }
     return self::$debugger;
 }
 /**
  * Create a new XmppPrebind Object with the required params
  *
  * @param string $jabberHost Jabber Server Host
  * @param string $boshUri    Full URI to the http-bind
  * @param string $resource   Resource identifier
  * @param bool   $useSsl     Use SSL (not working yet, TODO)
  * @param bool   $debug      Enable debug
  */
 public function __construct($jabberHost, $boshUri, $resource, $useSsl = false, $debug = false)
 {
     $this->jabberHost = $jabberHost;
     $this->boshUri = $boshUri;
     $this->resource = $resource;
     $this->useSsl = $useSsl;
     $this->debug = $debug;
     if ($this->debug === true) {
         $this->firePhp = FirePHP::getInstance(true);
         $this->firePhp->setEnabled(true);
     }
     /* TODO: Not working
     		 if (function_exists('gzinflate')) {
     			$this->useGzip = true;
     		}*/
     /*
      * The client MUST generate a large, random, positive integer for the initial 'rid' (see Security Considerations)
      * and then increment that value by one for each subsequent request. The client MUST take care to choose an
      * initial 'rid' that will never be incremented above 9007199254740991 [21] within the session.
      * In practice, a session would have to be extraordinarily long (or involve the exchange of an extraordinary
      * number of packets) to exceed the defined limit.
      *
      * @link http://xmpp.org/extensions/xep-0124.html#rids
      */
     if (function_exists('mt_rand')) {
         $this->rid = mt_rand(1000000000, 10000000000);
     } else {
         $this->rid = rand(1000000000, 10000000000);
     }
 }
| Include FirePHP class as FireAnbu dependency.
|
*/
Autoloader::map(array('FirePHP' => Bundle::path('fireanbu') . 'vendors' . DS . 'FirePHPCore' . DS . 'FirePHP.class' . EXT));
/*
|--------------------------------------------------------------------------
| FireAnbu IoC
|--------------------------------------------------------------------------
|
| Register FirePHP singleton using IoC, in case you need to overwrite the 
| implementation in your application.
|
*/
IoC::singleton('fireanbu', function () {
    $fb = new FirePHP();
    $fb->setEnabled(Config::get('fireanbu::fireanbu.profiler', true));
    return $fb;
});
/*
|--------------------------------------------------------------------------
| Listen to `laravel.log` events
|--------------------------------------------------------------------------
*/
Event::listen('laravel.log', function ($type, $message) {
    $fb = IoC::resolve('fireanbu');
    switch (Str::upper($type)) {
        case FirePHP::INFO:
        case FirePHP::WARN:
        case FirePHP::LOG:
        case FirePHP::ERROR:
            $fb->{$type}($message);