当前位置: 首页>>代码示例>>PHP>>正文


PHP log::write方法代码示例

本文整理汇总了PHP中log::write方法的典型用法代码示例。如果您正苦于以下问题:PHP log::write方法的具体用法?PHP log::write怎么用?PHP log::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在log的用法示例。


在下文中一共展示了log::write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: payment

 public function payment($sum)
 {
     // На бете альфе включаем дебаг режим
     if (!is_release()) {
         //$sum = 0.1;// @debug
         $this->api->setDebug(true);
     }
     $result = $this->api->requestPayment(round((double) $sum, 2), $this->account->id);
     if ($result['status'] == API_Webmoney::STATUS_SUCCESS) {
         $process = $this->api->processPayment($this->api->merchant_transaction_id, $result['processor_transaction_id']);
         switch ($process['status']) {
             case API_Webmoney::STATUS_PAYMENT_PROGRESS:
             case API_Webmoney::STATUS_PAYMENT_SUCCESS:
                 // Зачисляем деньги на бете/альфе
                 //                    if(!is_release()) {
                 //                        $paymentDateTime = date('d.m.Y H:i');
                 //                        $orderNumber     = rand(1, 99999999);
                 //                        $descr = "WebMoney с кошелька {$this->data['wallet']} сумма - {$sum}, обработан {$paymentDateTime}, номер покупки - $orderNumber";
                 //
                 //                        $this->account->deposit($op_id, $this->account->id, $sum, $descr, 3, $sum, 12);
                 //                    }
                 return true;
                 break;
             case API_Webmoney::STATUS_PAYMENT_FAIL:
                 ob_start();
                 var_dump($result);
                 var_dump($process);
                 $content = ob_get_clean();
                 $this->log->writeln("FAIL Payment:\naccount:{$this->account->id}\n");
                 $this->log->write("Request:\n " . $this->api->last_request->getBody());
                 $this->log->write("Result:\n {$content}");
                 return false;
                 break;
                 // Отложить платеж на пол часа
                 // @todo придумать как отложить запрос на потом
                 //case API_Webmoney::STATUS_PAYMENT_PROCESS:
             // Отложить платеж на пол часа
             // @todo придумать как отложить запрос на потом
             //case API_Webmoney::STATUS_PAYMENT_PROCESS:
             default:
                 return;
                 break;
         }
     } else {
         ob_start();
         var_dump($result);
         $content = ob_get_clean();
         $this->log->writeln("FAIL Payment:\naccount:{$this->account->id}\n");
         $this->log->write("Request:\n " . $this->api->last_request->getBody());
         $this->log->write("Result:\n {$content}");
         return false;
     }
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:53,代码来源:walletWebmoney.php

示例2: query

	public function query($sql){
		$rs = mysql_query($sql);
		log::write(date('Y-m-d H:i:s', time()).'--->'.$sql); //记录日志

		return $rs;

	}
开发者ID:xiaoxiaoJun,项目名称:phpper,代码行数:7,代码来源:mysql.class.php

示例3: query

 public function query($sql)
 {
     $rs = mysqli_query($this->conn, $sql);
     log::write($sql);
     log::write(time());
     return $rs;
 }
开发者ID:jingling0101,项目名称:nmfoxshop,代码行数:7,代码来源:mysql.class.php

示例4: query

 public function query($sql)
 {
     $rs = mysqli_query($this->conn, $sql);
     log::write($sql);
     //log::write("  result:" . $rs);
     return $rs;
 }
开发者ID:hsshhsshhssh,项目名称:bianli,代码行数:7,代码来源:mysql.class.php

示例5: clearMemcache

 public function clearMemcache()
 {
     $result = $this->memcached->flush();
     if (!$result) {
         log::write("MemDb::clearMemcach() failed", "log");
         return false;
     }
     return true;
 }
开发者ID:vvcumt,项目名称:zk,代码行数:9,代码来源:MemDb.lib.php

示例6: execute

function execute($sql)
{
    try {
        global $_conn;
        $_conn->execute($sql);
    } catch (Exception $e) {
        log::write($e->getMessage(), "execute");
    }
}
开发者ID:r0b0k,项目名称:PHP-FUS,代码行数:9,代码来源:inc_doctrine_config.php

示例7: test_writing_to_file

 function test_writing_to_file()
 {
     log::write(array(VAR_DIR . '/tmp/', 'test.log'), 'wow');
     $this->assertTrue(file_exists(VAR_DIR . '/tmp/test.log'));
     $arr = file(VAR_DIR . '/tmp/test.log');
     $this->assertNotNull($arr[0]);
     if (isset($_SERVER['REQUEST_URI'])) {
         $this->assertWantedPattern('|' . preg_quote($_SERVER['REQUEST_URI']) . '|', $arr[1]);
     }
     $this->assertWantedPattern('|wow|', $arr[2]);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:log.test.php

示例8: get

 /**
  * 获取账户信息
  *
  */
 public static function get($account_id)
 {
     $post_url = "http://manage.backstage-gateway.com/account";
     $post_var = "account_id=" . $account_id;
     $result = tool::curl_pay($post_url, $post_var);
     $res = @unserialize(stripcslashes($result));
     if (!is_array($res)) {
         log::write('data_error', $result, __FILE__, __LINE__);
     }
     return $res;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:15,代码来源:account.php

示例9: GetOne

 public function GetOne($id)
 {
     $query = 'SELECT * FROM ' . $this->tableName . ' WHERE id=:id';
     $param[':id'] = $id;
     $res = $this->query($query, $param);
     if (empty($res)) {
         $log = new log();
         $log->write('Trying to get unexisting article');
         throw new E404Exception('The article with id=' . $id . ' was not found');
     }
     return $this->query($query, $param)[0];
 }
开发者ID:AndreyLM,项目名称:home2,代码行数:12,代码来源:db.php

示例10: validate

 /**
  * Validates and optionally saves a new delivery category from an array.
  *
  * @param array value to check
  * @param boolean save the record when validation succeeds
  * @return boolean      
  */
 public function validate(array &$array, $save = FALSE, &$errors)
 {
     $fields = parent::as_array();
     $array = array_merge($fields, $array);
     $array = Validation::factory($array)->pre_filter('trim')->add_rules('name', 'required', 'length[1,255]')->add_rules('ename', 'required', 'length[1,255]')->add_rules('description', 'length[1,1000]')->add_rules('edescription', 'length[1,1000]');
     if (parent::validate($array, $save)) {
         return TRUE;
     } else {
         $errors = $array->errors();
         log::write('form_error', $errors, __FILE__, __LINE__);
         return FALSE;
     }
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:20,代码来源:delivery_category.php

示例11: query

 public function query($sql)
 {
     //	if($this->conf->debug){
     //		log::write($sql);
     //	}
     $rs = $this->conn->query($sql);
     log::write($sql);
     if (!$rs) {
         //log::write($this->error());
         log::write("error");
     }
     return $rs;
 }
开发者ID:qiushuiqs,项目名称:myshop,代码行数:13,代码来源:mysql.class.php

示例12: validate

 public function validate(array &$array, $save = FALSE, &$errors)
 {
     $fields = parent::as_array();
     $array = array_merge($fields, $array);
     $array = Validation::factory($array)->pre_filter('trim')->add_rules('status', 'numeric')->add_rules('manager_id', 'numeric')->add_rules('user_log_type', 'numeric')->add_rules('ip', 'length[0,255]')->add_rules('method', 'length[0,255]')->add_rules('memo', 'length[0,512]');
     if (parent::validate($array, $save)) {
         return TRUE;
     } else {
         $errors = $array->errors();
         log::write('form_error', $errors, __FILE__, __LINE__);
         return FALSE;
     }
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:13,代码来源:user_log.php

示例13: validate

 /**
  * Validates and optionally saves a new user record from an array.
  *
  * @param  array    values to check
  * @param  boolean  save the record when validation succeeds
  * @return boolean
  */
 public function validate(array &$array, $save = FALSE, &$errors)
 {
     $fields = parent::as_array();
     $array = array_merge($fields, $array);
     $array = Validation::factory($array)->pre_filter('trim')->add_rules('host', 'required', 'length[0,255]')->add_rules('port', 'required', 'numeric')->add_rules('username', 'required', 'length[0,255]')->add_rules('password', 'required', 'length[0,255]');
     if (parent::validate($array, $save)) {
         return TRUE;
     } else {
         $errors = $array->errors();
         log::write('Smtp_queue_form_error', $errors, __FILE__, __LINE__);
         return FALSE;
     }
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:20,代码来源:smtp_queue.php

示例14: error

 public static function error($errno, $errstr, $errfile, $errline)
 {
     switch ($errno) {
         case E_ERROR:
         case E_USER_ERROR:
             $errormsg = "[" . L("exceptionhd_error1") . "]{$errstr}\t[" . L("exceptionhd_error2") . "]{$errfile}\t[" . L("exceptionhd_error3") . "]{$errline}";
             log::write($errormsg);
             error($errormsg);
             break;
         case E_USER_WARNING:
         case E_USER_NOTICE:
         default:
             $errormsg = "[" . L("exceptionhd_error4") . "] {$errstr}\t[" . L("exceptionhd_error5") . "]{$errfile}\t[" . L("exceptionhd_error6") . "]{$errline}";
             self::notice(func_get_args());
             log::set($errormsg);
     }
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:17,代码来源:exceptionHD.class.php

示例15: customError

function customError($errno, $errstr, $errfile, $errline)
{
    global $_charset, $KYPHP, $kyphp_error_no, $kyphp_errors;
    switch ($errno) {
        case E_NOTICE:
        case E_USER_NOTICE:
            $error = $_charset['notice'];
            break;
        case E_WARNING:
        case E_USER_WARNING:
            $error = $_charset['warning'];
            break;
        case E_ERROR:
        case E_USER_ERROR:
            $error = $_charset['fatal'];
            break;
        default:
            $error = $_charset['unknow'];
            break;
    }
    if (empty($KYPHP)) {
        if (!strstr($errstr, 'mysql_close')) {
            echo $error . ':' . $errstr . 'at:' . $errfile . ' line:' . $errline;
        }
        return;
    }
    $error_display = $KYPHP->config->get('error_display');
    $error_log = $KYPHP->config->get('error_log');
    if (!$error_display) {
        $error_display = 'on';
    }
    if (!$error_log) {
        $error_log = 'on';
    }
    $kyphp_errors[] = array($errno, $errstr, $errfile, $errline);
    $KYPHP->config->set('error', $kyphp_errors);
    if ($error_log == 'on') {
        $log = new log('error.txt');
        $log->write($error . ':' . $errstr . ' at:' . $errfile . ' line:' . $errline);
    }
    if ($error_display == 'on') {
        kyphp_display_error($errno, $errstr, $errfile, $errline, $kyphp_error_no);
        $kyphp_error_no++;
    }
    //die();
}
开发者ID:sayi21cn,项目名称:kyphp2.0,代码行数:46,代码来源:message.php


注:本文中的log::write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。