示例#1
0
 /**
  * Override View_Core::render so that we trap errors stemming from bad PHP includes and show a
  * visible stack trace to help developers.
  *
  * @see View_Core::render
  */
 public function render($print=false, $renderer=false) {
   try {
     return parent::render($print, $renderer);
   } catch (Exception $e) {
     Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
     return "";
   }
 }
示例#2
0
 /**
  * Override View_Core::render so that we trap errors stemming from bad PHP includes and show a
  * visible stack trace to help developers.
  *
  * @see View_Core::render
  */
 public function render($print = false, $renderer = false)
 {
     try {
         return parent::render($print, $renderer);
     } catch (Exception $e) {
         if (!IN_PRODUCTION) {
             print $e->getTraceAsString();
             return $e->getMessage();
         }
         Kohana::Log('error', $e->getTraceAsString());
         Kohana::Log('debug', $e->getMessage());
         return "";
     }
 }
示例#3
0
 /**
  * Sets the config for the class.
  *
  * @param  array  config passed from the library
  */
 public function __construct($config)
 {
     $this->test_mode = $config['test_mode'];
     $this->fields['payment_url'] = $config['payment_url'];
     $this->fields['currency'] = $config['currency'];
     if ($this->test_mode) {
         $this->fields['test_pay_to_email'] = $config['test_pay_to_email'];
         $this->fields['test_password'] = $config['test_password'];
     } else {
         $this->fields['pay_to_email'] = $config['pay_to_email'];
         $this->fields['password'] = $config['password'];
     }
     $this->curl_config = $config['curl_config'];
     Kohana::Log('debug', 'MoneyBookers Payment Driver Initialized');
 }
示例#4
0
 /**
  * Sets the config for the class.
  *
  * @param  array  config passed from the library
  */
 public function __construct($config)
 {
     $this->fields['google_API_key'] = $config['google_API_key'];
     $this->fields['google_merchant_id'] = $config['google_merchant_id'];
     $this->fields['google_sandbox_API_key'] = $config['google_sandbox_API_key'];
     $this->fields['google_sandbox_merchant_id'] = $config['google_sandbox_merchant_id'];
     $this->curl_config = $config['curl_config'];
     $this->test_mode = $config['test_mode'];
     if ($this->test_mode) {
         $base64encoding = base64_encode($this->fields['google_sandbox_merchant_id'] . ":" . $this->fields['google_sandbox_API_key']);
     } else {
         $base64encoding = base64_encode($this->fields['google_merchant_id'] . ":" . $this->fields['google_API_key']);
     }
     $this->xml_header = array("Authorization: Basic " . $base64encoding, "Content-Type: application/xml;charset=UTF-8", "Accept: application/xml;charset=UTF-8");
     Kohana::Log('debug', 'Google Checkout Payment Driver Initialized');
 }
示例#5
0
            <?php 
echo t("File: <b>%file</b>, line: <b>%line</b>", array("file" => $file, "line" => $line));
?>
          </p>
        </div>
        <? endif ?>

        <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTrace(); ?>
        <? $trace = Kohana::backtrace($trace); ?>
        <? if (!empty($trace)): ?>
        <div id="stack_trace">
          <h3>
            <?php 
echo t("And here's how we got there:");
?>
          </h3>
          <?php 
echo $trace;
?>
          <? endif ?>
        </div>
      </div>
      <? else: ?>
      <? $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTraceAsString(); ?>
      <? if (!empty($trace)): ?>
      <? Kohana::Log("error", print_r($trace, 1)); ?>
      <? endif ?>
      <? endif ?>
  </body>
</html>
示例#6
0
 static function batch_complete()
 {
     try {
         notification::send_pending_notifications();
     } catch (Exception $e) {
         Kohana::log("error", "@todo notification_event::batch_complete() failed");
         Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
     }
 }