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

PHP gmdate函数代码示例

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

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



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

示例1: export

 function export()
 {
     global $mainframe;
     $model = $this->getModel('attendees');
     $datas = $model->getData();
     header('Content-Type: text/x-csv');
     header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Content-Disposition: attachment; filename=attendees.csv');
     header('Pragma: no-cache');
     $k = 0;
     $export = '';
     $col = array();
     for ($i = 0, $n = count($datas); $i < $n; $i++) {
         $data =& $datas[$i];
         $col[] = str_replace("\"", "\"\"", $data->name);
         $col[] = str_replace("\"", "\"\"", $data->username);
         $col[] = str_replace("\"", "\"\"", $data->email);
         $col[] = str_replace("\"", "\"\"", JHTML::Date($data->uregdate, JText::_('DATE_FORMAT_LC2')));
         $col[] = str_replace("\"", "\"\"", $data->uid);
         for ($j = 0; $j < count($col); $j++) {
             $export .= "\"" . $col[$j] . "\"";
             if ($j != count($col) - 1) {
                 $export .= ";";
             }
         }
         $export .= "\r\n";
         $col = '';
         $k = 1 - $k;
     }
     echo $export;
     $mainframe->close();
 }
开发者ID:reeleis,项目名称:ohiocitycycles,代码行数:32,代码来源:attendees.php


示例2: __toString

 /**
  * Returns the cookie as a string.
  *
  * @return string The cookie
  */
 public function __toString()
 {
     $str = urlencode($this->getName()) . '=';
     if ('' === (string) $this->getValue()) {
         $str .= 'deleted; expires=' . gmdate('D, d-M-Y H:i:s T', time() - 31536001);
     } else {
         $str .= urlencode($this->getValue());
         if ($this->getExpiresTime() !== 0) {
             $str .= '; expires=' . gmdate('D, d-M-Y H:i:s T', $this->getExpiresTime());
         }
     }
     if ($this->path) {
         $str .= '; path=' . $this->path;
     }
     if ($this->getDomain()) {
         $str .= '; domain=' . $this->getDomain();
     }
     if (true === $this->isSecure()) {
         $str .= '; secure';
     }
     if (true === $this->isHttpOnly()) {
         $str .= '; httponly';
     }
     return $str;
 }
开发者ID:sonfordson,项目名称:Laravel-Fundamentals,代码行数:30,代码来源:Cookie.php


示例3: transfer

 /**
  * {@inheritdoc}
  */
 protected function transfer()
 {
     while (!$this->stopped && !$this->source->isConsumed()) {
         if ($this->source->getContentLength() && $this->source->isSeekable()) {
             // If the stream is seekable and the Content-Length known, then stream from the data source
             $body = new ReadLimitEntityBody($this->source, $this->partSize, $this->source->ftell());
         } else {
             // We need to read the data source into a temporary buffer before streaming
             $body = EntityBody::factory();
             while ($body->getContentLength() < $this->partSize && $body->write($this->source->read(max(1, min(10 * Size::KB, $this->partSize - $body->getContentLength()))))) {
             }
         }
         // @codeCoverageIgnoreStart
         if ($body->getContentLength() == 0) {
             break;
         }
         // @codeCoverageIgnoreEnd
         $params = $this->state->getUploadId()->toParams();
         $command = $this->client->getCommand('UploadPart', array_replace($params, array('PartNumber' => count($this->state) + 1, 'Body' => $body, 'ContentMD5' => (bool) $this->options['part_md5'], Ua::OPTION => Ua::MULTIPART_UPLOAD)));
         // Notify observers that the part is about to be uploaded
         $eventData = $this->getEventData();
         $eventData['command'] = $command;
         $this->dispatch(self::BEFORE_PART_UPLOAD, $eventData);
         // Allow listeners to stop the transfer if needed
         if ($this->stopped) {
             break;
         }
         $response = $command->getResponse();
         $this->state->addPart(UploadPart::fromArray(array('PartNumber' => count($this->state) + 1, 'ETag' => $response->getHeader('ETag', true), 'Size' => $body->getContentLength(), 'LastModified' => gmdate(DateFormat::RFC2822))));
         // Notify observers that the part was uploaded
         $this->dispatch(self::AFTER_PART_UPLOAD, $eventData);
     }
 }
开发者ID:romainneutron,项目名称:aws-sdk-php,代码行数:36,代码来源:SerialTransfer.php


示例4: seconds

 /**
  * Formats a second into years, months, days, hours, minutes, seconds.
  * 
  * Example:
  * format::seconds(65) returns "1 minute, 5 seconds"
  * 
  * @param	int		number of seconds
  * @return	string	formatted seconds
  */
 public static function seconds($seconds)
 {
     list($years, $months, $days, $hours, $minutes, $seconds) = explode(":", gmdate("Y:n:j:G:i:s", $seconds));
     $years -= 1970;
     $months--;
     $days--;
     $parts = array();
     if ($years > 0) {
         $parts[] = $years . " " . str::plural("year", $years);
     }
     if ($months > 0) {
         $parts[] = $months . " " . str::plural("month", $months);
     }
     if ($days > 0) {
         $parts[] = $days . " " . str::plural("day", $days);
     }
     if ($hours > 0) {
         $parts[] = $hours . " " . str::plural("hour", $hours);
     }
     if ($minutes > 0) {
         $parts[] = sprintf("%d", $minutes) . " " . str::plural("minute", $minutes);
     }
     if ($seconds > 0) {
         $parts[] = sprintf("%d", $seconds) . " " . str::plural("second", $seconds);
     }
     return implode(", ", $parts);
 }
开发者ID:enormego,项目名称:EightPHP,代码行数:36,代码来源:format.php


示例5: httpNoCache

function httpNoCache()
{
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Pragma: no-cache");
    header("Cache-Control: no-cache, must-revalidate");
}
开发者ID:conjuringtricks,项目名称:PowerLoader,代码行数:7,代码来源:common.php


示例6: afterFind

 public function afterFind()
 {
     $this->cost = number_format($this->cost / 100, 2, '.', ',');
     $this->timestamp = gmdate('dS-M-Y', $this->timestamp);
     $this->service_status = $this->service_status === '1' ? "Active" : "Inactive";
     return parent::afterFind();
 }
开发者ID:jacjimus,项目名称:furahia_mis,代码行数:7,代码来源:Services.php


示例7: action_index

    public function action_index()
    {
        header("Last-Modified: " . gmdate('D, d M Y H:i:s T'));
        header("Expires: " . gmdate('D, d M Y H:i:s T', time() + 315360000));
        header("Cache-Control: max-age=315360000");
        header('Content-Type: text/cache-manifest; charset=utf-8');
        //header("HTTP/1.1 304 Not Modified");
        $version = date('Y-m-d H:i:s');
        echo <<<EOF
CACHE MANIFEST

# VERSION {$version}

# 直接缓存的文件
CACHE:
/media/MDicons/css/MDicon.min.css
/media/mdl/material.cyan-red.min.css
/media/mdl/material.min.js
/media/sidebarjs/sidebarjs.css
/media/css/weui.min.css
/media/js/jquery.min.js
/media/sidebarjs/sidebarjs.js
/media/MDicons/fonts/mdicon.woff
http://7xkkhh.com1.z0.glb.clouddn.com/2016/08/01/14700177870141.jpg?imageView2/1/w/600/h/302

# 需要在线访问的文件
NETWORK:
*

# 替代方案
FALLBACK:
#/ offline.html
EOF;
        exit;
    }
开发者ID:andygoo,项目名称:cms,代码行数:35,代码来源:Manifest.php


示例8: graphs

function graphs()
{
    $t = $_GET["t"];
    /*
    if($t=='day'){$day='id=tab_current';$title=$t;$t="1$t";}
    if($t=='week'){$week='id=tab_current';$t="2$t";}
    if($t=='month'){$month='id=tab_current';$t="3$t";}	
    
    <div id=tablist>
    <li><a href=\"javascript:LoadAjax2('graphs','$page?graph=yes&hostname={$_GET["hostname"]}&t=day');\">{day}</a></li>
    <li><a href=\"javascript:LoadAjax2('graphs','$page?graph=yes&hostname={$_GET["hostname"]}&t=week');\">{week}</a></li>
    <li><a href=\"javascript:LoadAjax2('graphs','$page?graph=yes&hostname={$_GET["hostname"]}&t=month');\">{month}</a></li>
    </div>*/
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("content-type:text/html");
    $md = md5(date('Ymdhis'));
    $users = new usersMenus(nul, 0, $_GET["hostname"]);
    $html = "\n<input type='hidden' id='t' value='{$t}'>\n<p class='caption'>{queue_flow_text}</p>\n<table style='width:600px' align=center>\n<tr>\n<td valign='top'>\n\t<center style='margin:4px'>\n\t\t<H5>{queue_flow_day}</H5>\n\t\t<img src='images.listener.php?uri=mailgraph/queuegraph_0.png&md={$md}'>\n\t</center>\n\t<center style='margin:4px'>\n\t\t<H5>{queue_flow_week}</H5>\n\t\t<img src='images.listener.php?uri=mailgraph/queuegraph_1.png&md={$md}'>\n\t</center>\n\t<center style='margin:4px'>\n\t\t<H5>{queue_flow_month}</H5>\n\t\t<img src='images.listener.php?uri=mailgraph/queuegraph_2.png&md={$md}'>\n\t</center>\n\t<center style='margin:4px'>\n\t\t<H5>{queue_flow_year}</H5>\n\t\t<img src='images.listener.php?uri=mailgraph/queuegraph_3.png&md={$md}'>\n\t</center>\t\t\t\t\t\t\n</td>\n</tr>\n</table>\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:brucewu16899,项目名称:artica,代码行数:25,代码来源:statistics.queuegraph.php


示例9: delete_multi

 /**
  * @author KhaVu
  * @copyright 2015-04-21
  * @param $param
  * @return 
  */
 function delete_multi($id)
 {
     $now = gmdate("Y-m-d H:i:s", time() + 7 * 3600);
     //$sql = "UPDATE `gds_stock_device` SET `del_if` = 1, `dateupdated` = '$now' WHERE `device_id` IN ($id)  and `device_id` > 0";
     //$this->model->query($sql)->execute();
     $this->model->table('gds_stock_device')->where("device_id in({$id})")->update(array('del_if' => 1, 'dateupdated' => $now));
 }
开发者ID:khavq,项目名称:smdemo,代码行数:13,代码来源:model.php


示例10: getCacheHeaders

 public function getCacheHeaders(ConcretePage $c)
 {
     $lifetime = $c->getCollectionFullPageCachingLifetimeValue();
     $expires = gmdate('D, d M Y H:i:s', time() + $lifetime) . ' GMT';
     $headers = array('Pragma' => 'public', 'Cache-Control' => 'max-age=' . $lifetime . ',s-maxage=' . $lifetime, 'Expires' => $expires);
     return $headers;
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:7,代码来源:PageCache.php


示例11: doGet

 /**
  * Do a GET request.
  *
  * @param resource $ch
  * @param string $url
  * @throws CurlException
  * @return string
  */
 private function doGet($ch, $url)
 {
     $now = time();
     $resource = $this->getResourceName($url);
     $date = $this->cache->getDate($resource);
     $limit = $now - $this->ttl;
     //Return content if ttl has not yet expired.
     if ($date > 0 && $date > $limit) {
         return $this->cache->getContent($resource);
     }
     //Add the If-Modified-Since header
     if ($date > 0) {
         curl_setopt($ch, CURLOPT_HTTPHEADER, array(sprintf("If-Modified-Since: %s GMT", gmdate("D, d M Y H:i:s", $date))));
     }
     curl_setopt($ch, CURLOPT_FILETIME, true);
     $data = $this->curlExec($ch);
     $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     $date = curl_getinfo($ch, CURLINFO_FILETIME);
     curl_close($ch);
     //Return content from cache.
     if ($httpCode == 304) {
         $this->cache->setDate($resource, $date);
         return $this->cache->getContent($resource);
     }
     //Cache content
     if ($httpCode == 200) {
         $date = $date >= 0 ? $date : $now;
         $this->cache->cache($resource, $date, $data);
         return $data;
     }
     throw new CurlException(sprintf('Cannot fetch %s', $url), $httpCode);
 }
开发者ID:kaibosh,项目名称:nZEDb,代码行数:40,代码来源:CacheClient.php


示例12: setCacheHeader

 /**
  * @param $expires
  */
 public function setCacheHeader($expires)
 {
     $this->setHeader('Last-Modified', gmdate('D, d M Y H:i:s T', time()));
     $this->setHeader('Expires', gmdate('D, d M Y H:i:s T', time() + $expires));
     $this->setHeader('Cache-Control', 'private, max-age=' . $expires);
     $this->setHeader('Pragma', '');
 }
开发者ID:ateliee,项目名称:pmp,代码行数:10,代码来源:response.php


示例13: retrieveFile

 /**
  * Retrieves data from cache, if it's there.  If it is, but it's expired,
  * it performs a conditional GET to see if the data is updated.  If it
  * isn't, it down updates the modification time of the cache file and
  * returns the data.  If the cache is not there, or the remote file has been
  * modified, it is downloaded and cached.
  *
  * @param string URL of remote file to retrieve
  * @param int Length of time to cache file locally before asking the server
  *            if it changed.
  * @return string File contents
  */
 function retrieveFile($url, $cacheLength, $cacheDir)
 {
     $cacheID = md5($url);
     $cache = new Cache_Lite(array("cacheDir" => $cacheDir, "lifeTime" => $cacheLength));
     if ($data = $cache->get($cacheID)) {
         return $data;
     } else {
         // we need to perform a request, so include HTTP_Request
         include_once 'HTTP/Request.php';
         // HTTP_Request has moronic redirect "handling", turn that off (Alexey Borzov)
         $req = new HTTP_Request($url, array('allowRedirects' => false));
         // if $cache->get($cacheID) found the file, but it was expired,
         // $cache->_file will exist
         if (isset($cache->_file) && file_exists($cache->_file)) {
             $req->addHeader('If-Modified-Since', gmdate("D, d M Y H:i:s", filemtime($cache->_file)) . " GMT");
         }
         $req->sendRequest();
         if (!($req->getResponseCode() == 304)) {
             // data is changed, so save it to cache
             $data = $req->getResponseBody();
             $cache->save($data, $cacheID);
             return $data;
         } else {
             // retrieve the data, since the first time we did this failed
             if ($data = $cache->get($cacheID, 'default', true)) {
                 return $data;
             }
         }
     }
     Services_ExchangeRates::raiseError("Unable to retrieve file {$url} (unknown reason)", SERVICES_EXCHANGERATES_ERROR_RETRIEVAL_FAILED);
     return false;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:44,代码来源:Common.php


示例14: getOrderBy

 /**
  * checks the request for the order by and if that is not set then it checks the session for it
  *
  * @return array containing the keys orderBy => field being ordered off of and sortOrder => the sort order of that field
  */
 function getOrderBy($orderBy = '', $direction = '')
 {
     if (!empty($orderBy) || !empty($_REQUEST[$this->var_order_by])) {
         if (!empty($_REQUEST[$this->var_order_by])) {
             $direction = 'ASC';
             $orderBy = $_REQUEST[$this->var_order_by];
             if (!empty($_REQUEST['lvso']) && (empty($_SESSION['lvd']['last_ob']) || strcmp($orderBy, $_SESSION['lvd']['last_ob']) == 0)) {
                 $direction = $_REQUEST['lvso'];
                 $trackerManager = TrackerManager::getInstance();
                 if ($monitor = $trackerManager->getMonitor('tracker')) {
                     $monitor->setValue('module_name', $GLOBALS['module']);
                     $monitor->setValue('item_summary', "lvso=" . $direction . "&" . $this->var_order_by . "=" . $_REQUEST[$this->var_order_by]);
                     $monitor->setValue('action', 'listview');
                     $monitor->setValue('user_id', $GLOBALS['current_user']->id);
                     $monitor->setValue('date_modified', gmdate($GLOBALS['timedate']->get_db_date_time_format()));
                     $monitor->save();
                 }
             }
         }
         $_SESSION[$this->var_order_by] = array('orderBy' => $orderBy, 'direction' => $direction);
         $_SESSION['lvd']['last_ob'] = $orderBy;
     } else {
         if (!empty($_SESSION[$this->var_order_by])) {
             $orderBy = $_SESSION[$this->var_order_by]['orderBy'];
             $direction = $_SESSION[$this->var_order_by]['direction'];
         }
     }
     return array('orderBy' => $orderBy, 'sortOrder' => $direction);
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:34,代码来源:ListViewData.php


示例15: timestampToRFC2616

 /**
  * Convert an epoch timestamp into an RFC2616 (HTTP) compatible date.
  * @param type $timestamp Optionally, an epoch timestamp. Defaults to the current time.
  */
 public static function timestampToRFC2616($timestamp = false)
 {
     if ($timestamp === false) {
         $timestamp = time();
     }
     return gmdate('D, d M Y H:i:s T', (int) $timestamp);
 }
开发者ID:smartboyathome,项目名称:Known,代码行数:11,代码来源:Time.php


示例16: _htmlHeader

    /** Build the HTML header. Includes doctype definition, <html> and <head>
     * sections, meta data and window title.
     *
     * @return str
     */
    function _htmlHeader($title)
    {
        $output = $this->_doctype();
        $output .= '<html lang="en">' . "\n";
        $output .= "<head>\n\n";
        $output .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . "\n\n";
        $output .= '<meta name="generator" content="PHPDoctor ' . $this->_doclet->version() . ' (http://peej.github.com/phpdoctor/)">' . "\n";
        $output .= '<meta name="when" content="' . gmdate('r') . '">' . "\n\n";
        $output .= '<link rel="stylesheet" type="text/css" href="' . str_repeat('../', $this->_depth) . 'stylesheet.css">' . "\n";
        $output .= '<link rel="start" href="' . str_repeat('../', $this->_depth) . 'overview-summary.html">' . "\n\n";
        $output .= '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>' . "\n";
        $output .= '<script type="text/javascript">
			$(document).ready(function() {
				$(\'iframe\').load(function() {
				  this.style.height =
				  this.contentWindow.document.body.offsetHeight + \'px\';
				});
			});
		</script>' . "\n";
        $output .= '<title>';
        if ($title) {
            $output .= $title . ' (' . $this->_doclet->windowTitle() . ')';
        } else {
            $output .= $this->_doclet->windowTitle();
        }
        $output .= "</title>\n\n";
        $output .= "</head>\n";
        return $output;
    }
开发者ID:Naatan,项目名称:CrossORM,代码行数:34,代码来源:htmlWriter.php


示例17: setStatus

 /**
  * setting methods
  */
 public function setStatus($status)
 {
     $user = $this->getUser();
     switch ($status) {
         case 'pending':
             $this->decline_date = null;
             $this->accept_date = null;
             $this->save();
             $user->owner_flag = 0;
             break;
         case 'denied':
             $this->decline_date = gmdate('Y-m-d H:i:s');
             $this->accept_date = null;
             $this->save();
             Mail::send('emails.ownership-denied', array('user' => $user), function ($message) {
                 $message->to($this->getUser()->email, $this->getUser()->getFullName());
                 $message->subject('SWAMP Owner Application Denied');
             });
             $user->owner_flag = 0;
             break;
         case 'approved':
             $this->accept_date = gmdate('Y-m-d H:i:s');
             $this->decline_date = null;
             $this->save();
             Mail::send('emails.ownership-approved', array('user' => $user), function ($message) {
                 $message->to($this->getUser()->email, $this->getUser()->getFullName());
                 $message->subject('SWAMP Owner Application Approved');
             });
             $user->owner_flag = 1;
             break;
     }
 }
开发者ID:pombredanne,项目名称:open-swamp,代码行数:35,代码来源:OwnerApplication.php


示例18: getFarmsList

 /**
  * Gets the list of farms
  *
  * @param string $query optional Search query
  * @return array        Retuens array of farms
  */
 private function getFarmsList($query = null)
 {
     $farms = [];
     $collection = $this->getContainer()->analytics->usage->findFarmsByKey($this->environment->id, $query);
     if ($collection->count()) {
         $iterator = ChartPeriodIterator::create('month', gmdate('Y-m-01'), null, 'UTC');
         $criteria = ['envId' => $this->environment->id];
         //It calculates usage for all provided cost centres
         $usage = $this->getContainer()->analytics->usage->getFarmData($this->environment->clientId, $criteria, $iterator->getStart(), $iterator->getEnd(), [TagEntity::TAG_ID_FARM, TagEntity::TAG_ID_FARM_ROLE, TagEntity::TAG_ID_PLATFORM]);
         //It calculates usage for previous period same days
         $prevusage = $this->getContainer()->analytics->usage->getFarmData($this->environment->clientId, $criteria, $iterator->getPreviousStart(), $iterator->getPreviousEnd(), [TagEntity::TAG_ID_FARM]);
         foreach ($collection as $dbFarm) {
             /* @var $dbFarm \DBFarm */
             $totalCost = round(isset($usage['data'][$dbFarm->ID]) ? $usage['data'][$dbFarm->ID]['cost'] : 0, 2);
             $farms[$dbFarm->ID] = $this->getFarmData($dbFarm);
             if (isset($usage['data'][$dbFarm->ID]['data'])) {
                 $farms[$dbFarm->ID]['topSpender'] = $this->getFarmRoleTopSpender($usage['data'][$dbFarm->ID]['data']);
             } else {
                 $farms[$dbFarm->ID]['topSpender'] = null;
             }
             $prevCost = round(isset($prevusage['data'][$dbFarm->ID]) ? $prevusage['data'][$dbFarm->ID]['cost'] : 0, 2);
             $farms[$dbFarm->ID] = $this->getWrappedUsageData(['farmId' => $dbFarm->ID, 'iterator' => $iterator, 'usage' => $totalCost, 'prevusage' => $prevCost]) + $farms[$dbFarm->ID];
         }
     }
     return array_values($farms);
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:32,代码来源:Farms.php


示例19: gzipoutput

function gzipoutput($text)
{
    global $HTTP_ACCEPT_ENCODING;
    $returntext = $text;
    if (function_exists("crc32") and function_exists("gzcompress")) {
        if (strpos(" " . $HTTP_ACCEPT_ENCODING, "x-gzip")) {
            $encoding = "x-gzip";
        }
        if (strpos(" " . $HTTP_ACCEPT_ENCODING, "gzip")) {
            $encoding = "gzip";
        }
        if ($encoding) {
            header("Content-Encoding: {$encoding}");
            header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
            // Date in the past
            header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
            // always modified
            header("Cache-Control: no-store, no-cache, must-revalidate");
            // HTTP/1.1
            header("Cache-Control: post-check=0, pre-check=0", false);
            header("Pragma: no-cache");
            // HTTP/1.0
            $size = strlen($text);
            $crc = crc32($text);
            $returntext = "‹";
            $returntext .= substr(gzcompress($text, 1), 0, -4);
            $returntext .= pack("V", $crc);
            $returntext .= pack("V", $size);
        }
    }
    return $returntext;
}
开发者ID:jbreitbart,项目名称:priceguard_classic,代码行数:32,代码来源:conf.php


示例20: _remakeURI

 private function _remakeURI($baseurl, $params)
 {
     // Timestamp パラメータを追加します
     // - 時間の表記は ISO8601 形式、タイムゾーンは UTC(GMT)
     $params['Timestamp'] = gmdate('Y-m-d\\TH:i:s\\Z');
     // パラメータの順序を昇順に並び替えます
     ksort($params);
     // canonical string を作成します
     $canonical_string = '';
     foreach ($params as $k => $v) {
         $canonical_string .= '&' . $this->_urlencode_rfc3986($k) . '=' . $this->_urlencode_rfc3986($v);
     }
     $canonical_string = substr($canonical_string, 1);
     // 署名を作成します
     // - 規定の文字列フォーマットを作成
     // - HMAC-SHA256 を計算
     // - BASE64 エンコード
     $parsed_url = parse_url($baseurl);
     $string_to_sign = "GET\n{$parsed_url['host']}\n{$parsed_url['path']}\n{$canonical_string}";
     $signature = base64_encode(hash_hmac('sha256', $string_to_sign, SECRET_KEY, true));
     // URL を作成します
     // - リクエストの末尾に署名を追加
     $url = $baseurl . '?' . $canonical_string . '&Signature=' . $this->_urlencode_rfc3986($signature);
     return $url;
 }
开发者ID:AmazonAPIDev,项目名称:amazon_project,代码行数:25,代码来源:amazon.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP gmdate_format函数代码示例发布时间:2022-05-15
下一篇:
PHP gmDate函数代码示例发布时间: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