コード例 #1
0
ファイル: Posts.php プロジェクト: daftspunk/oc-test-plugin
 public function onDeleteWithReason($recordId = null)
 {
     $result = $this->asExtension('FormController')->update_onDelete($recordId);
     $model = $this->formGetModel();
     $reason = post('reason');
     traceLog(sprintf('The post "%s" was deleted with reason "%s"', $model->name, $reason));
     return $result;
 }
コード例 #2
0
 public static function createRecord($statusId, $invoice, $comment = null)
 {
     if ($statusId instanceof Model) {
         $statusId = $statusId->getKey();
     }
     if ($invoice->status_id == $statusId) {
         return false;
     }
     $previousStatus = $invoice->status_id;
     /*
      * Create record
      */
     $record = new static();
     $record->status_id = $statusId;
     $record->invoice_id = $invoice->id;
     $record->comment = $comment;
     /*
      * Extensibility
      */
     if (Event::fire('responsiv.pay:beforeUpdateInvoiceStatus', [$record, $invoice, $statusId, $previousStatus], true) === false) {
         return false;
     }
     if ($record->fireEvent('pay:beforeUpdateInvoiceStatus', [$record, $invoice, $statusId, $previousStatus], true) === false) {
         return false;
     }
     $record->save();
     /*
      * Update invoice status
      */
     $invoice->newQuery()->where('id', $invoice->id)->update(['status_id' => $statusId, 'status_updated_at' => Carbon::now()]);
     $statusPaid = InvoiceStatus::getStatusPaid();
     if (!$statusPaid) {
         return traceLog('Unable to find payment status with paid code');
     }
     // @todo Send email notifications
     if ($statusId == $statusPaid->id) {
         // Invoice is paid
     }
 }
コード例 #3
0
ファイル: MediaManager.php プロジェクト: GoldBest/october
 protected function copyBrokenImage($path)
 {
     try {
         $thumbnailDir = dirname($path);
         if (!File::isDirectory($thumbnailDir)) {
             if (File::makeDirectory($thumbnailDir, 0777, true) === false) {
                 return;
             }
         }
         File::copy($this->getBrokenImagePath(), $path);
     } catch (Exception $ex) {
         traceLog($ex->getMessage());
     }
 }
コード例 #4
0
ファイル: Lists.php プロジェクト: keiosweb/october
 /**
  * Common mistake, relation is not a valid list column.
  * @deprecated Remove if year >= 2018
  */
 protected function evalRelationTypeValue($record, $column, $value)
 {
     traceLog(sprintf('Warning: List column type "relation" for class "%s" is not valid.', get_class($record)));
     return $this->evalTextTypeValue($record, $column, $value);
 }
コード例 #5
0
ファイル: Helper.php プロジェクト: Tripplefix/pfadiorion
 /**
  * @deprecated Moved to Html::clean
  */
 public static function clean($html)
 {
     traceLog('HtmlHelper::clean has been deprecated, use Html::clean instead.');
     return Html::clean($string);
 }
コード例 #6
0
    echo "导入公钥文件失败!";
    exit;
}
//取得退款应答中的各项值
$merid = $_REQUEST["MerID"];
$orderno = $_REQUEST["OrderId"];
$refundamount = $_REQUEST["RefundAmout"];
$currencycode = $_REQUEST["currencycode"];
$processdate = $_REQUEST["ProcessDate"];
$sendtime = $_REQUEST["SendTime"];
$transtype = $_REQUEST["TransType"];
$status = $_REQUEST["Status"];
$checkvalue = $_REQUEST["CheckValue"];
$priv1 = $_REQUEST["Priv1"];
$plain = $merid . $processdate . $transtype . $orderno . $refundamount . $status . $priv1;
//本示例在这里记录文件日志,方便您测试是否收到应答
traceLog("refund.log", $plain);
$flag = verify($plain, $checkvalue);
if ($flag) {
    //验证签名成功,
    echo "<h4>验证签名成功</h4>";
    if ($status == '3') {
        //退款完成
        echo "<h3>退款成功</h3>";
        //请把您自己需要处理的逻辑写在这里,
    } else {
        echo "<h3>退款失败</h3>";
    }
} else {
    echo "<h4>验证签名失败!</h4>";
}
コード例 #7
0
ファイル: helpers.php プロジェクト: kkkatya/archigallery2
 /**
  * Begins to monitor all SQL output.
  * @return void
  */
 function traceSql()
 {
     define('OCTOBER_NO_EVENT_LOGGING', 1);
     Event::listen('illuminate.query', function ($query, $bindings, $time, $name) {
         $data = compact('bindings', 'time', 'name');
         foreach ($bindings as $i => $binding) {
             if ($binding instanceof \DateTime) {
                 $bindings[$i] = $binding->format('\'Y-m-d H:i:s\'');
             } else {
                 if (is_string($binding)) {
                     $bindings[$i] = "'{$binding}'";
                 }
             }
         }
         $query = str_replace(array('%', '?'), array('%%', '%s'), $query);
         $query = vsprintf($query, $bindings);
         traceLog($query);
     });
 }
コード例 #8
0
ファイル: MailBlocker.php プロジェクト: BOOMER74/user-plugin
 /**
  * @deprecated Use MailBlocker::setPreferences instead
  * @TODO Remove this function in the next major version or if year >= 2017
  */
 public static function toggleBlocks($templates, $user, array $inTemplates = null)
 {
     traceLog('MailBlocker::toggleBlocks is deprecated, please use MailBlocker::setPreferences instead');
     foreach ((array) $templates as $template => $value) {
         if ($inTemplates && !array_key_exists($template, $inTemplates) && !in_array($template, $inTemplates)) {
             continue;
         }
         // Template uses an alias
         if (isset($inTemplates[$template])) {
             $template = $inTemplates[$template];
         }
         if ($value) {
             static::removeBlock($template, $user);
         } else {
             static::addBlock($template, $user);
         }
     }
 }
コード例 #9
0
ファイル: Str.php プロジェクト: sajjad-ser/library
 /**
  * @deprecated Moved to October\Rain\Html\Helper::clean
  */
 public static function cleanHtml($string)
 {
     traceLog('Str::cleanHtml has been deprecated, use Html::clean instead.');
     return Html::clean($string);
 }
コード例 #10
0
ファイル: Page.php プロジェクト: pietercolpaert/swagsite
 /**
  * Helper that makes a URL for a page in the active theme.
  * @param mixed $page Specifies the Cms Page file name.
  * @param array $params Route parameters to consider in the URL.
  * @return string
  */
 public static function url($page, $params = [], $absolute = true)
 {
     /* @deprecated remove if year >= 2016 -- remove 3rd argument */
     if ($absolute !== true) {
         traceLog('Deprecated warning: Third argument of Page::url() has no affect, consider removing it.');
     }
     /*
      * Reuse existing controller or create a new one,
      * assuming that the method is called not during the front-end
      * request processing.
      */
     $controller = Controller::getController();
     if (!$controller) {
         $controller = new Controller();
     }
     return $controller->pageUrl($page, $params, true);
 }
コード例 #11
0
ファイル: Form.php プロジェクト: janusnic/OctoberCMS
 /**
  * Returns postback data from a submitted form.
  */
 public function getSaveData()
 {
     $data = $this->arrayName ? post($this->arrayName) : post();
     if (!$data) {
         $data = [];
     }
     /*
      * Number fields should be converted to integers
      */
     foreach ($this->fields as $field) {
         if ($field->type != 'number') {
             continue;
         }
         /*
          * Handle HTML array, eg: item[key][another]
          */
         $parts = Str::evalHtmlArray($field->fieldName);
         $dotted = implode('.', $parts);
         if (($value = array_get($data, $dotted)) !== null) {
             $value = !strlen(trim($value)) ? null : (double) $value;
             array_set($data, $dotted, $value);
         }
     }
     /*
      * Give widgets an opportunity to process the data.
      */
     foreach ($this->formWidgets as $field => $widget) {
         $parts = Str::evalHtmlArray($field);
         $dotted = implode('.', $parts);
         $widgetValue = $widget->getSaveValue(array_get($data, $dotted));
         /*
          * @deprecated Remove if year >= 2016
          */
         if (method_exists($widget, 'getSaveData')) {
             traceLog('Method getSaveData() is deprecated, use getSaveValue() instead. Found in: ' . get_class($widget), 'warning');
             $widgetValue = $widget->getSaveData(array_get($data, $dotted));
         }
         array_set($data, $dotted, $widgetValue);
     }
     /*
      * Handle fields that differ by fieldName and valueFrom
      */
     $remappedFields = [];
     foreach ($this->fields as $field) {
         if ($field->fieldName == $field->valueFrom) {
             continue;
         }
         /*
          * Get the value, remove it from the data collection
          */
         $parts = Str::evalHtmlArray($field->fieldName);
         $dotted = implode('.', $parts);
         $value = array_get($data, $dotted);
         array_forget($data, $dotted);
         /*
          * Set the new value to the data collection
          */
         $parts = Str::evalHtmlArray($field->valueFrom);
         $dotted = implode('.', $parts);
         array_set($remappedFields, $dotted, $value);
     }
     if (count($remappedFields) > 0) {
         $data = array_merge($remappedFields, $data);
         // Could be useful one day for field name collisions
         // $data['X_OCTOBER_REMAPPED_FIELDS'] = $remappedFields;
     }
     return $data;
 }
コード例 #12
0
 /**
  * @deprecated getTranslateAttribute is deprecated, use getAttributeTranslated instead.
  * @todo Remove method if year >= 2017
  */
 public function getTranslateAttribute($key, $locale = null)
 {
     traceLog(static::class . '::getTranslateAttribute is deprecated, use getAttributeTranslated instead.');
     return $this->getAttributeTranslated($key, $locale);
 }
コード例 #13
0
ファイル: commonlib.php プロジェクト: thantalas/slim-nne
function traceDebug($msg, $file = false)
{
    if (TRACE_DEBUG || $file) {
        if (empty($msg)) {
            return;
        }
        $dbg = debug_backtrace();
        $dbg = $dbg[0];
        $f = explode("/", $dbg['file']);
        $n = count($f);
        $fi = isset($f[$n - 2]) ? $f[$n - 2] : '';
        $fi .= isset($f[$n - 1]) ? "/" . $f[$n - 1] : '';
        $f = !empty($file) ? $file : "debug_%date%";
        if (is_array($msg)) {
            traceLog(' [' . $fi . ' ' . $dbg['line'] . ']:' . print_r($msg, true), false, $f);
        } else {
            traceLog(' [' . $fi . ' ' . $dbg['line'] . ']:' . $msg, false, $f);
        }
    }
}
コード例 #14
0
ファイル: Hashable.php プロジェクト: richlove1/avc-october
 /**
  * @deprecated use self::addHashable()
  * Remove this method if year >= 2018
  */
 public function addHashableAttribute($attribute)
 {
     traceLog('The addHashableAttribute() method is deprecated, use addHashable() instead.');
     return $this->addHashable($attribute);
 }