Exemplo n.º 1
0
function xapp_clog($message = '')
{
    $type = XApp_Service_Entry_Utils::getConsoleType();
    if ($type === 'firephp') {
        xapp_console($message);
    } elseif ($type === 'chromephp') {
        Xapp_Console::instance('chromephp')->info($message);
    }
    return;
}
Exemplo n.º 2
0
 /**
  * creates singleton instance and passes all options to class constructor
  *
  * @see Xapp_Console::__construct
  * @error 10902
  * @param null|string $driver expects the driver string to load
  * @param array $options expects an driver dependent option array
  * @return null|Xapp_Console
  */
 public static function instance($driver = null, array $options = array())
 {
     if (self::$_instance === null) {
         self::$_instance = new self($driver, $options);
     }
     return self::$_instance;
 }
Exemplo n.º 3
0
 /**
  * xapp console shortcut function will tunnel all debug/console messages to Xapp_Console wrapper class which will handle
  * redirection to loaded php console class located in /ext directory such as FirePhp for firefox or ChromePhp for chrome
  * browser. Console logging is be default disabled. enable by overwritting global conf constant XAPP_CONF_CONSOLE with
  * either:
  * 1)   true = load default driver for FirePhp
  * 2)   instance of Xapp_Console = already instantiated wrapper class
  * 3)   string = defining the driver to load (e.g. firephp, chromephp)
  * 4)   null|false = to disable console logging
  * to route xapps default debug messages to php console use xapp conf constant XAPP_CONF_DEBUG_MODE = 4 or "console"
  * to rout all error messages into php console
  *
  * overwrite like:
  * <code>
  *      xapp_console($m = null, $l = null, $t = 'info', Array $o = array())
  *      {
  *          //your custom code here
  *      }
  * </code>
  *
  * @param null|mixed $m message - expects any value that can be send to console via the loaded driver
  * @param null|string $l label - expects an optional label to be display to explain log value
  * @param string $t type - expects the log type. see Xapp_Console for all log types
  * @param array $o options - expects further options. see loaded console driver for more
  * @return void
  */
 function xapp_console($m = null, $l = null, $t = 'info', array $o = array())
 {
     if (xapped('Xapp_Console') && (bool) xapp_conf(XAPP_CONF_CONSOLE)) {
         if (is_object(xapp_conf(XAPP_CONF_CONSOLE)) && xapp_conf(XAPP_CONF_CONSOLE) instanceof Xapp_Console) {
             xapp_conf(XAPP_CONF_CONSOLE)->log($m, $l, $t, $o);
         } else {
             if (xapp_conf(XAPP_CONF_CONSOLE) === true) {
                 Xapp_Console::instance('firephp')->log($m, $l, $t, $o);
             } else {
                 Xapp_Console::instance((string) xapp_conf(XAPP_CONF_CONSOLE))->log($m, $l, $t, $o);
             }
         }
     } else {
         xapp_debug($m);
     }
 }