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


PHP log::addLog方法代码示例

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


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

示例1: update

 /**
  * 通过id获取信息
  */
 public function update($_POST)
 {
     $log = new log();
     $log->addLog("update test", 1);
     $columns[0] = "field1";
     $values[0] = $_POST['field1'];
     $columns[1] = "field2";
     $values[1] = $_POST['field2'];
     $row = $this->db->updateParamById("test", $columns, $values, "id", $_POST['id']);
     return $row;
 }
开发者ID:huangzhichao,项目名称:php_dwz,代码行数:14,代码来源:class.test.php

示例2: die

<?php

require_once 'lib/medoo.php';
require_once 'class/log.class.php';
require __DIR__ . '/vendor/autoload.php';
if (file_exists('config.php')) {
    require_once 'config.php';
} else {
    die('Local config not found. Please create one from config.sample.php and name it config.php');
}
require_once 'class/log.class.php';
require __DIR__ . '/vendor/autoload.php';
try {
    log::addLog('Chiamata webhooks');
    // create Telegram API object
    $telegram = new Longman\TelegramBot\Telegram($token, $botname);
    $telegram->enableMySQL($credentials);
    $telegram->enableAdmins(array($adminId));
    $telegram->setLogRequests(true);
    $telegram->setLogPath($botname . '.log');
    $COMMANDS_FOLDER = __DIR__ . '/command/';
    $telegram->addCommandsPath($COMMANDS_FOLDER);
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
    log::addLog(print_r($e, true));
}
开发者ID:NonnEmilia,项目名称:panizziBot,代码行数:25,代码来源:boot.php

示例3: function

 * Remember remove this examples to avoid collisions in routes
 */
//load Micro Framework with debug enabled
$app = new \OnePHP\App();
$app->get('/telegramBot/', function () use($app, $aTParam) {
    //Action on the Root URL
    return $app->ResponseHTML("\r\n        <a href=\"https://api.telegram.org/bot" . $aTParam['token'] . "/setWebhook?url=" . $aTParam['urlWebhooks'] . "\"> attiva WebHooks </a> <br/>\r\n        <a href=\"https://api.telegram.org/bot" . $aTParam['token'] . "/setWebhook?url=\"> disattiva WebHooks </a> <br/>\r\n        <a href=\"https://api.telegram.org/bot" . $aTParam['token'] . "/getUpdates\"> getUpdate WebHooks </a> <br/>\r\n        <a href=\"https://api.telegram.org/bot" . $aTParam['token'] . "/getMe\"> getMe </a> <br/>");
});
$app->post('/telegramBot/command.php', function () use($app, $database) {
    log::addLog('Chiamata');
    try {
        $message = json_decode(file_get_contents('php://input'), true);
        log::addLog(print_r($message, true));
        $database->insert("log", ["chat_idMessage" => $message['message']['message_id'], "chat_idUser" => $message['message']['from']['id'], "chat_name" => $message['message']['from']['first_name'], "chat_surname" => $message['message']['from']['last_name'], "chat_username" => $message['message']['from']['username'], "chat_date" => $message['message']['date'], "chat_text" => $message['message']['text'], "chat_log" => print_r($message, true)]);
    } catch (Exception $e) {
        log::addLog('Caught exception: ' . $e->getMessage());
    }
    return $app->ResponseHTML("Finito.");
});
$app->get('/telegramBot/message.php', function () use($app, $aTParam) {
    $data = array('chat_id' => 28751773, 'text' => 'ciao io funziono...');
    $request = new HTTPRequest($aTParam['urlCommand'] . 'sendMessage', HTTP_METH_POST);
    $request->setRawPostData($data);
    $request->send();
    $response = $request->getResponseBody();
    print_r($response);
    //// use key 'http' even if you send the request to https://...
    //    $options = array(
    //        'http' => array(
    //            'header' => "Content-type: application/x-www-form-urlencoded\r\n",
    //            'method' => 'POST',
开发者ID:NonnEmilia,项目名称:panizziBot,代码行数:31,代码来源:index.php


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