• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP logger函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中logger函数的典型用法代码示例。如果您正苦于以下问题:PHP logger函数的具体用法?PHP logger怎么用?PHP logger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: send

 /**
  * Send a multipart/alternative message with Text and HTML versions
  *
  * @param fromName			name of the sender
  * @param fromEmail			email fo the sender
  * @param replyTo			replyTo address to direct responses
  * @param toEmail			destination email address
  * @param messageSubject	subject of the message
  * @param htmlVersion		html version of the message
  * @param textVersion		text only version of the message
  * @param additionalMailHeader	additions to the smtp mail header
  * @param optional uid      user id of the destination user
  */
 public static function send($params)
 {
     call_hooks('emailer_send_prepare', $params);
     $email_textonly = False;
     if (x($params, "uid")) {
         $email_textonly = get_pconfig($params['uid'], "system", "email_textonly");
     }
     $fromName = email_header_encode(html_entity_decode($params['fromName'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
     $messageSubject = email_header_encode(html_entity_decode($params['messageSubject'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
     // generate a mime boundary
     $mimeBoundary = rand(0, 9) . "-" . rand(10000000000, 99999999999) . "-" . rand(10000000000, 99999999999) . "=:" . rand(10000, 99999);
     // generate a multipart/alternative message header
     $messageHeader = $params['additionalMailHeader'] . "From: {$fromName} <{$params['fromEmail']}>\n" . "Reply-To: {$fromName} <{$params['replyTo']}>\n" . "MIME-Version: 1.0\n" . "Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
     // assemble the final multipart message body with the text and html types included
     $textBody = chunk_split(base64_encode($params['textVersion']));
     $htmlBody = chunk_split(base64_encode($params['htmlVersion']));
     $multipartMessageBody = "--" . $mimeBoundary . "\n" . "Content-Type: text/plain; charset=UTF-8\n" . "Content-Transfer-Encoding: base64\n\n" . $textBody . "\n";
     if (!$email_textonly && !is_null($params['htmlVersion'])) {
         $multipartMessageBody .= "--" . $mimeBoundary . "\n" . "Content-Type: text/html; charset=UTF-8\n" . "Content-Transfer-Encoding: base64\n\n" . $htmlBody . "\n";
     }
     $multipartMessageBody .= "--" . $mimeBoundary . "--\n";
     // message ending
     // send the message
     $hookdata = array('to' => $params['toEmail'], 'subject' => $messageSubject, 'body' => $multipartMessageBody, 'headers' => $messageHeader);
     //echo "<pre>"; var_dump($hookdata); killme();
     call_hooks("emailer_send", $hookdata);
     $res = mail($hookdata['to'], $hookdata['subject'], $hookdata['body'], $hookdata['headers']);
     logger("header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
     logger("return value " . ($res ? "true" : "false"), LOGGER_DEBUG);
     return $res;
 }
开发者ID:ZerGabriel,项目名称:friendica,代码行数:44,代码来源:Emailer.php


示例2: search_ac_init

function search_ac_init(&$a)
{
    if (!local_channel()) {
        killme();
    }
    $start = x($_REQUEST, 'start') ? $_REQUEST['start'] : 0;
    $count = x($_REQUEST, 'count') ? $_REQUEST['count'] : 100;
    $search = x($_REQUEST, 'search') ? $_REQUEST['search'] : "";
    if (x($_REQUEST, 'query') && strlen($_REQUEST['query'])) {
        $search = $_REQUEST['query'];
    }
    // Priority to people searches
    if ($search) {
        $people_sql_extra = protect_sprintf(" AND `xchan_name` LIKE '%" . dbesc($search) . "%' ");
        $tag_sql_extra = protect_sprintf(" AND term LIKE '%" . dbesc($search) . "%' ");
    }
    $r = q("SELECT `abook_id`, `xchan_name`, `xchan_photo_s`, `xchan_url`, `xchan_addr` FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d \n\t\t{$people_sql_extra}\n\t\tORDER BY `xchan_name` ASC ", intval(local_channel()));
    $results = array();
    if ($r) {
        foreach ($r as $g) {
            $results[] = array("photo" => $g['xchan_photo_s'], "name" => '@' . $g['xchan_name'], "id" => $g['abook_id'], "link" => $g['xchan_url'], "label" => '', "nick" => '');
        }
    }
    $r = q("select distinct term, tid, url from term where type in ( %d, %d ) {$tag_sql_extra} group by term order by term asc", intval(TERM_HASHTAG), intval(TERM_COMMUNITYTAG));
    if (count($r)) {
        foreach ($r as $g) {
            $results[] = array("photo" => $a->get_baseurl() . '/images/hashtag.png', "name" => '#' . $g['term'], "id" => $g['tid'], "link" => $g['url'], "label" => '', "nick" => '');
        }
    }
    header("content-type: application/json");
    $o = array('start' => $start, 'count' => $count, 'items' => $results);
    echo json_encode($o);
    logger('search_ac: ' . print_r($x, true));
    killme();
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:35,代码来源:search_ac.php


示例3: read_json

 public function read_json($data)
 {
     if (!is_array($data)) {
         logger(' source data is not a array.');
         return;
     }
     foreach ($data as $value) {
         if ($value['audio']) {
             $audio = $value['audio'];
             if ($audio['title_photo']) {
                 $this->picArray[] = $audio['title_photo'];
             }
             if ($audio['content_photo']) {
                 $this->picArray[] = $audio['content_photo'];
             }
             if ($audio['wetsound_path']) {
                 $this->mp3Array[] = $audio['wetsound_path'];
             }
             if (isset($audio['addPicList'])) {
                 $addPicList = $audio['addPicList'];
                 if (!is_array($addPicList)) {
                     return;
                 }
                 foreach ($addPicList as $value) {
                     $this->picArray[] = $value['content_pic'];
                 }
             }
         }
     }
 }
开发者ID:pengzhengrong,项目名称:account,代码行数:30,代码来源:tourism_url_download.php


示例4: __construct

 public function __construct($dsn, $user, $password)
 {
     parent::__construct($dsn, $user, $password);
     $this->query("SET NAMES ´utf8´");
     $this->query("SET CHARACTER SET utf8");
     logger("INFO", "Database Class Initialized");
 }
开发者ID:emrecete,项目名称:fmr,代码行数:7,代码来源:Database.php


示例5: getFromRouter

 public static function getFromRouter(Router $router)
 {
     $mode = $router->getMode();
     $parameters = [];
     $path = preg_replace_callback('/\\/\\${.*}/U', function ($matches) use(&$parameters) {
         $parameters[] = preg_replace('/\\/|\\$|\\{|\\}/', '', $matches[0]);
         return '';
     }, $router->getPath());
     $patharr = array_merge(explode('/', $router->getBase()), explode('/', $path));
     $path = array_filter(array_map(function ($p) {
         return \camelCase($p, true, '-');
     }, $patharr));
     if ($mode === Router::MOD_RESTFUL) {
         $request = $router->getRequest();
         $method = strtoupper($_POST['_method'] ?? $request->getMethod());
         $action = $router->getActionOfRestful($method);
         if ($action === null) {
             throw new \Leno\Http\Exception(501);
         }
     } else {
         $action = preg_replace_callback('/^[A-Z]/', function ($matches) {
             if (isset($matches[0])) {
                 return strtolower($matches[0]);
             }
         }, preg_replace('/\\..*$/', '', array_pop($path)));
     }
     try {
         return (new self(implode('\\', $path) . 'Controller'))->setMethod($action)->setParameters($parameters);
     } catch (\Exception $ex) {
         logger()->err((string) $ex);
         throw new \Leno\Http\Exception(404);
     }
 }
开发者ID:hackyoung,项目名称:leno,代码行数:33,代码来源:Target.php


示例6: bookmarks_init

function bookmarks_init(&$a)
{
    if (!local_user()) {
        return;
    }
    $item_id = intval($_REQUEST['item']);
    if (!$item_id) {
        return;
    }
    $u = $a->get_channel();
    $i = q("select * from item where id = %d and uid = %d limit 1", intval($item_id), intval(local_user()));
    if (!$i) {
        return;
    }
    $i = fetch_post_tags($i);
    $item = $i[0];
    $terms = get_terms_oftype($item['term'], TERM_BOOKMARK);
    if ($terms && !$item['item_restrict']) {
        require_once 'include/bookmarks.php';
        $s = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($item['author_xchan']));
        if (!$s) {
            logger('mod_bookmarks: author lookup failed.');
            killme();
        }
        foreach ($terms as $t) {
            bookmark_add($u, $s[0], $t, $item['item_private']);
            info(t('Bookmark added') . EOL);
        }
    }
    killme();
}
开发者ID:Mauru,项目名称:red,代码行数:31,代码来源:bookmarks.php


示例7: servePostRequest

function servePostRequest($params)
{
    //logger("POST Params : ".print_r($params, true) );
    switch ($params['task']) {
        case 'UPDATE_MODULE':
            $ret = updateLineItem($params);
            break;
            // Handles the case when a module/project/item has to be marked complete. Identifiers in $params['identifier']
        // Handles the case when a module/project/item has to be marked complete. Identifiers in $params['identifier']
        case 'MARK_COMPLETE':
            $tmp = $params['identifier']['project_name'];
            $tmp_proj = new ProjectController();
            $tmp_proj->markAsComplete($params);
            logger("{$tmp} is COMPLETE");
            break;
            // Handles the case when a module/project/item is to be marked invalid. Identifiers in $params['identifier']
        // Handles the case when a module/project/item is to be marked invalid. Identifiers in $params['identifier']
        case 'MARK_DISABLED':
            $tmp = $params['identifier']['project_name'];
            $tmp_proj = new ProjectController();
            $tmp_proj->markAsInactive($params);
            logger("{$tmp} is INVALID");
            break;
        case 'NEW_PROJECT':
            $ret = addNewProject($params);
            //$ret = "New project initiated";
            break;
        default:
            # code...
            break;
    }
    return $ret;
}
开发者ID:pallavdiablo,项目名称:Panorama,代码行数:33,代码来源:webservice.php


示例8: init

 function init()
 {
     $result = array('success' => false);
     $mindate = $_REQUEST['mindate'] ? datetime_convert('UTC', 'UTC', $_REQUEST['mindate']) : '';
     if (!$mindate) {
         $mindate = datetime_convert('UTC', 'UTC', 'now - 14 days');
     }
     if (observer_prohibited()) {
         $result['message'] = 'Public access denied';
         json_return_and_die($result);
     }
     $observer = \App::get_observer();
     $channel_address = argc() > 1 ? argv(1) : '';
     if ($channel_address) {
         $r = q("select channel_id, channel_name from channel where channel_address = '%s' and channel_removed = 0 limit 1", dbesc(argv(1)));
     } else {
         $x = get_sys_channel();
         if ($x) {
             $r = array($x);
         }
         $mindate = datetime_convert('UTC', 'UTC', 'now - 14 days');
     }
     if (!$r) {
         $result['message'] = 'Channel not found.';
         json_return_and_die($result);
     }
     logger('zotfeed request: ' . $r[0]['channel_name'], LOGGER_DEBUG);
     $result['messages'] = zot_feed($r[0]['channel_id'], $observer['xchan_hash'], array('mindate' => $mindate));
     $result['success'] = true;
     json_return_and_die($result);
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:31,代码来源:Zotfeed.php


示例9: testHelpersFacade

 public function testHelpersFacade()
 {
     $this->assertInstanceOf(\Clarity\Support\Auth\Auth::class, auth());
     $this->assertInstanceOf(\Phalcon\Config::class, config());
     $this->assertInstanceOf(\Phalcon\Mvc\Dispatcher::class, dispatcher());
     $this->assertInstanceOf(\Phalcon\Filter::class, filter());
     $this->assertInstanceOf(\Phalcon\Flash\Direct::class, flash()->direct());
     $this->assertInstanceOf(\Phalcon\Flash\Session::class, flash()->session());
     $this->assertInstanceOf(\League\Flysystem\Filesystem::class, flysystem());
     $this->assertInstanceOf(\League\Flysystem\MountManager::class, flysystem_manager());
     $this->assertInstanceOf(\Clarity\Support\Redirect\Redirect::class, redirect());
     $this->assertInstanceOf(\Clarity\Support\Phalcon\Http\Request::class, request());
     $this->assertInstanceOf(\Phalcon\Http\Response::class, response());
     $this->assertInstanceOf(\Phalcon\Mvc\Router::class, route());
     $this->assertInstanceOf(\Phalcon\Security::class, security());
     $this->assertInstanceOf(\Phalcon\Tag::class, tag());
     $this->assertInstanceOf(\Phalcon\Mvc\Url::class, url());
     $this->assertInstanceOf(\Phalcon\Mvc\View::class, view());
     # getting an error, will check later on
     $this->assertInstanceOf(\Monolog\Logger::class, logger());
     # adapter base functions
     // $this->assertInstanceOf(, cache());
     // $this->assertInstanceOf(, db());
     // $this->assertInstanceOf(, queue());
     // $this->assertInstanceOf(, session());
     $this->assertContains(url()->getBaseUri() . 'auth/login', route('showLoginForm'));
     $this->assertInstanceOf(\Phalcon\Mvc\View::class, view('welcome'));
 }
开发者ID:phalconslayer,项目名称:framework,代码行数:28,代码来源:HelpersTest.php


示例10: notes_init

/** @file */
function notes_init(&$a)
{
    if (!local_channel()) {
        return;
    }
    $ret = array('success' => true);
    if (array_key_exists('note_text', $_REQUEST)) {
        $body = escape_tags($_REQUEST['note_text']);
        // I've had my notes vanish into thin air twice in four years.
        // Provide a backup copy if there were contents previously
        // and there are none being saved now.
        if (!$body) {
            $old_text = get_pconfig(local_channel(), 'notes', 'text');
            if ($old_text) {
                set_pconfig(local_channel(), 'notes', 'text.bak', $old_text);
            }
        }
        set_pconfig(local_channel(), 'notes', 'text', $body);
    }
    // push updates to channel clones
    if (argc() > 1 && argv(1) === 'sync') {
        require_once 'include/zot.php';
        build_sync_packet();
    }
    logger('notes saved.', LOGGER_DEBUG);
    json_return_and_die($ret);
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:28,代码来源:notes.php


示例11: pubsub_post

function pubsub_post(&$a)
{
    $xml = file_get_contents('php://input');
    logger('pubsub: feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd);
    logger('pubsub: user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
    logger('pubsub: data: ' . $xml, LOGGER_DATA);
    //	if(! stristr($xml,'<?xml')) {
    //		logger('pubsub_post: bad xml');
    //		hub_post_return();
    //	}
    $nick = $a->argc > 1 ? notags(trim($a->argv[1])) : '';
    $contact_id = $a->argc > 2 ? intval($a->argv[2]) : 0;
    $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1", dbesc($nick));
    if (!count($r)) {
        hub_post_return();
    }
    $importer = $r[0];
    $r = q("SELECT * FROM `contact` WHERE `subhub` = 1 AND `id` = %d AND `uid` = %d \n\t\tAND ( `rel` = %d OR `rel` = %d OR network = '%s' ) AND `blocked` = 0 AND `readonly` = 0 LIMIT 1", intval($contact_id), intval($importer['uid']), intval(CONTACT_IS_SHARING), intval(CONTACT_IS_FRIEND), dbesc(NETWORK_FEED));
    if (!count($r)) {
        logger('pubsub: no contact record for "' . $nick . ' (' . $contact_id . ')" - ignored. ' . $xml);
        hub_post_return();
    }
    $contact = $r[0];
    // we have no way to match Diaspora guid's with atom post id's and could get duplicates.
    // we'll assume that direct delivery is robust (and this is a bad assumption, but the duplicates are messy).
    if ($r[0]['network'] === NETWORK_DIASPORA) {
        hub_post_return();
    }
    $feedhub = '';
    require_once 'include/items.php';
    consume_feed($xml, $importer, $contact, $feedhub, 1, 1);
    // do it a second time so that any children find their parents.
    consume_feed($xml, $importer, $contact, $feedhub, 1, 2);
    hub_post_return();
}
开发者ID:jzacman,项目名称:friendica,代码行数:35,代码来源:pubsub.php


示例12: query

 function query($query)
 {
     if ($this->debug) {
         logger("DB:" . $this->name, "Query: " . substr($query, 0, $this->traceLength));
     }
     return parent::query($query);
 }
开发者ID:BackupTheBerlios,项目名称:sotf-svn,代码行数:7,代码来源:db_Wrap.class.php


示例13: generateForm

 private function generateForm()
 {
     $fieldTemplate = $this->getTemplate($this->templatePath . 'form_field.blade');
     $fields = [];
     logger($this->fillableColumns);
     foreach ($this->fillableColumns as $column) {
         switch ($column['type']) {
             case 'integer':
                 $inputType = 'number';
                 break;
             case 'text':
                 $inputType = 'textarea';
                 break;
             case 'date':
                 $inputType = $column['type'];
                 break;
             case 'boolean':
                 $inputType = 'checkbox';
                 break;
             default:
                 $inputType = 'text';
                 break;
         }
         $fields[] = $this->compile($fieldTemplate, ['FIELD_NAME' => $column['field'], 'LABEL' => title_case(str_replace('_', ' ', $column['field'])), 'INPUT_TYPE' => $inputType]);
     }
     $templateData = $this->templateData;
     $templateData['FIELDS'] = implode("\n\n", $fields);
     $filename = 'form.blade.php';
     $this->generateFile($filename, $templateData, $this->templatePath . 'form.blade');
 }
开发者ID:19peaches,项目名称:laravel-generator,代码行数:30,代码来源:ViewGenerator.php


示例14: run

 public static function run($argc, $argv)
 {
     /**
      * Cron Weekly
      * 
      * Actions in the following block are executed once per day only on Sunday (once per week).
      *
      */
     call_hooks('cron_weekly', datetime_convert());
     z_check_cert();
     require_once 'include/hubloc.php';
     prune_hub_reinstalls();
     mark_orphan_hubsxchans();
     // get rid of really old poco records
     q("delete from xlink where xlink_updated < %s - INTERVAL %s and xlink_static = 0 ", db_utcnow(), db_quoteinterval('14 DAY'));
     $dirmode = intval(get_config('system', 'directory_mode'));
     if ($dirmode === DIRECTORY_MODE_SECONDARY || $dirmode === DIRECTORY_MODE_PRIMARY) {
         logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())), true));
     }
     // Check for dead sites
     Master::Summon(array('Checksites'));
     // update searchable doc indexes
     Master::Summon(array('Importdoc'));
     /**
      * End Cron Weekly
      */
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:27,代码来源:Cron_weekly.php


示例15: fromapp_uninstall

function fromapp_uninstall()
{
    unregister_hook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
    unregister_hook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
    unregister_hook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
    logger("removed fromapp");
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:7,代码来源:fromapp.php


示例16: update

 /**
  * Update the business service types.
  *
  * @param Business $business
  * @param Request  $request
  *
  * @return Response
  */
 public function update(Business $business, Request $request)
 {
     logger()->info(__METHOD__);
     logger()->info(sprintf('businessId:%s', $business->id));
     $this->authorize('manageServices', $business);
     // BEGIN
     $servicetypeSheet = $request->input('servicetypes');
     $regex = '/(?P<name>[a-zA-Z\\d\\-\\ ]+)\\:(?P<description>[a-zA-Z\\d\\ ]+)/im';
     preg_match_all($regex, $servicetypeSheet, $matches, PREG_SET_ORDER);
     $publishing = collect($matches)->map(function ($item) {
         $data = array_only($item, ['name', 'description']);
         $data['slug'] = str_slug($data['name']);
         return $data;
     });
     foreach ($business->servicetypes as $servicetype) {
         if (!$this->isPublished($servicetype, $publishing)) {
             $servicetype->delete();
         }
     }
     foreach ($publishing as $servicetypeData) {
         $servicetype = ServiceType::firstOrNew($servicetypeData);
         $business->servicetypes()->save($servicetype);
     }
     flash()->success(trans('servicetype.msg.update.success'));
     return redirect()->route('manager.business.service.index', [$business]);
 }
开发者ID:josevh,项目名称:timegrid,代码行数:34,代码来源:ServiceTypeController.php


示例17: chat_post

function chat_post(&$a)
{
    if ($_POST['room_name']) {
        $room = strip_tags(trim($_POST['room_name']));
    }
    if (!$room || !local_channel()) {
        return;
    }
    $channel = $a->get_channel();
    if ($_POST['action'] === 'drop') {
        logger('delete chatroom');
        chatroom_destroy($channel, array('cr_name' => $room));
        goaway(z_root() . '/chat/' . $channel['channel_address']);
    }
    $acl = new AccessList($channel);
    $acl->set_from_array($_REQUEST);
    $arr = $acl->get();
    $arr['name'] = $room;
    $arr['expire'] = intval($_POST['chat_expire']);
    if (intval($arr['expire']) < 0) {
        $arr['expire'] = 0;
    }
    chatroom_create($channel, $arr);
    $x = q("select * from chatroom where cr_name = '%s' and cr_uid = %d limit 1", dbesc($room), intval(local_channel()));
    build_sync_packet(0, array('chatroom' => $x));
    if ($x) {
        goaway(z_root() . '/chat/' . $channel['channel_address'] . '/' . $x[0]['cr_id']);
    }
    // that failed. Try again perhaps?
    goaway(z_root() . '/chat/' . $channel['channel_address'] . '/new');
}
开发者ID:msooon,项目名称:hubzilla,代码行数:31,代码来源:chat.php


示例18: chat_post

function chat_post(&$a)
{
    if ($_POST['room_name']) {
        $room = strip_tags(trim($_POST['room_name']));
    }
    if (!$room || !local_channel()) {
        return;
    }
    $channel = $a->get_channel();
    if ($_POST['action'] === 'drop') {
        logger('delete chatroom');
        chatroom_destroy($channel, array('cr_name' => $room));
        goaway(z_root() . '/chat/' . $channel['channel_address']);
    }
    $arr = array('name' => $room);
    $arr['allow_gid'] = perms2str($_REQUEST['group_allow']);
    $arr['allow_cid'] = perms2str($_REQUEST['contact_allow']);
    $arr['deny_gid'] = perms2str($_REQUEST['group_deny']);
    $arr['deny_cid'] = perms2str($_REQUEST['contact_deny']);
    chatroom_create($channel, $arr);
    $x = q("select cr_id from chatroom where cr_name = '%s' and cr_uid = %d limit 1", dbesc($room), intval(local_channel()));
    if ($x) {
        goaway(z_root() . '/chat/' . $channel['channel_address'] . '/' . $x[0]['cr_id']);
    }
    // that failed. Try again perhaps?
    goaway(z_root() . '/chat/' . $channel['channel_address'] . '/new');
}
开发者ID:redmatrix,项目名称:red,代码行数:27,代码来源:chat.php


示例19: _send_instructions

 /**
  * Sends the instructions to a user's email address.
  *
  * @return bool
  */
 private static function _send_instructions($name, Model_User $user)
 {
     $config_key = null;
     switch ($name) {
         case 'confirmation':
             $config_key = 'confirmable';
             break;
         case 'reset_password':
             $config_key = 'recoverable';
             break;
         case 'unlock':
             $config_key = 'lockable';
             break;
         default:
             throw new \InvalidArgumentException("Invalid instruction: {$name}");
     }
     $mail = \Email::forge();
     $mail->from(\Config::get('email.defaults.from.email'), \Config::get('email.defaults.from.name'));
     $mail->to($user->email);
     $mail->subject(__("warden.mailer.subject.{$name}"));
     $token_name = "{$name}_token";
     $mail->html_body(\View::forge("warden/mailer/{$name}_instructions", array('username' => $user->username, 'uri' => \Uri::create(':url/:token', array('url' => rtrim(\Config::get("warden.{$config_key}.url"), '/'), 'token' => $user->{$token_name})))));
     $mail->priority(\Email::P_HIGH);
     try {
         return $mail->send();
     } catch (\EmailSendingFailedException $ex) {
         logger(\Fuel::L_ERROR, "Warden\\Mailer failed to send {$name} instructions.");
         return false;
     }
 }
开发者ID:jkapelner,项目名称:chatroom-web-server,代码行数:35,代码来源:mailer.php


示例20: __construct

 /**
  * Extends parent constructor to detect availability of cURL
  *
  * @param   string  $resource
  * @param   array   $options
  * @throws  \RuntimeException
  */
 public function __construct($resource, array $options)
 {
     // check if we have libcurl available
     if (!class_exists('SoapClient')) {
         throw new \RuntimeException('Your PHP installation doesn\'t have Soap enabled. Rebuild PHP with --enable-soap');
     }
     logger(\Fuel::L_INFO, 'Creating a new SOAP Request with URI = "' . $resource . '"', __METHOD__);
     // If authentication is enabled use it
     if (!empty($options['user']) and !empty($options['pass'])) {
         $this->set_option('login', $options['user']);
         $this->set_option('password', $options['pass']);
     }
     // WSDL-mode only options
     if (!empty($resource)) {
         foreach (static::$wsdl_settings as $setting) {
             isset($options[$setting]) and $this->set_option($setting, $options[$setting]);
         }
     } else {
         $resource = null;
         if (!isset($options['location']) or !isset($options['uri'])) {
             throw new \RequestException('The keys "location" and "uri" are required in non-WSDL mode.');
         }
         foreach (static::$non_wsdl_settings as $setting) {
             isset($options[$setting]) and $this->set_option($setting, $options[$setting]);
         }
     }
     foreach (static::$generic_settings as $setting) {
         isset($options[$setting]) and $this->set_option($setting, $options[$setting]);
     }
     // make it always throw exceptions
     $this->set_option('exceptions', true);
     parent::__construct($resource, $options);
 }
开发者ID:quickpacket,项目名称:noclayer,代码行数:40,代码来源:soap.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP logger_print函数代码示例发布时间:2022-05-15
下一篇:
PHP loggedinorreturn函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap