예제 #1
0
function vmTrace($notice, $force = FALSE)
{
    if ($force || VMConfig::showDebug()) {
        ob_start();
        echo '<pre>';
        debug_print_backtrace();
        echo '</pre>';
        $body = ob_get_contents();
        ob_end_clean();
        if (VmConfig::$echoDebug) {
            echo $notice . ' <pre>' . $body . '</pre>';
        } else {
            if (VmConfig::$logDebug) {
                logInfo($body, $notice);
            } else {
                $app = JFactory::getApplication();
                $app->enqueueMessage($notice . ' ' . $body . ' ');
            }
        }
    }
}
예제 #2
0
/**
 * logInfo
 * to help debugging Payment notification for example
 */
function logInfo($text, $type = 'message')
{
    if (VMConfig::showDebug()) {
        $file = JPATH_ROOT . "/logs/" . VmConfig::$logFileName . ".log";
        $date = JFactory::getDate();
        $fp = fopen($file, 'a');
        fwrite($fp, "\n\n" . $date->toFormat('%Y-%m-%d %H:%M:%S'));
        fwrite($fp, "\n" . $type . ': ' . $text);
        fclose($fp);
    }
}
예제 #3
0
function vmTrace($notice, $force = false)
{
    if ($force || VMConfig::showDebug()) {
        //$app = JFactory::getApplication();
        //
        ob_start();
        echo '<pre>';
        debug_print_backtrace();
        echo '</pre>';
        $body = ob_get_contents();
        ob_end_clean();
        $app = JFactory::getApplication();
        $app->enqueueMessage($notice . ' <pre>' . $body . '</pre>');
    }
}
예제 #4
0
 /**
  * Setter of VMConfig
  *
  * @param VMConfig $VMConfig
  *
  * @return static
  */
 public function setVMConfig(VMConfig $VMConfig)
 {
     $this->VMConfig = $VMConfig;
     $VMConfig->addProcess($this);
     return $this;
 }