當前位置: 首頁>>代碼示例>>PHP>>正文


PHP functions::hash方法代碼示例

本文整理匯總了PHP中functions::hash方法的典型用法代碼示例。如果您正苦於以下問題:PHP functions::hash方法的具體用法?PHP functions::hash怎麽用?PHP functions::hash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在functions的用法示例。


在下文中一共展示了functions::hash方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct($params)
 {
     $file = 'console-' . date(@$params['log'] ?: 'Y-m-d') . '.log';
     $this->_file = \loader::get_temp($file);
     $this->_uid = substr(\functions::hash(microtime(true)), -5);
     $this->_head();
 }
開發者ID:egregor-dev,項目名稱:SatCMS,代碼行數:7,代碼來源:FileConsole.php

示例2: _hash

 /**
  * Gets some hash
  */
 private function _hash($what)
 {
     return functions::hash($what);
 }
開發者ID:rustyJ4ck,項目名稱:moswarBot,代碼行數:7,代碼來源:page_cacher.php

示例3: make_key

 /**
  * Make session key
  */
 function make_key()
 {
     $key = $this->salt;
     if ($this->with_browser) {
         $key .= isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
     }
     if ($this->ip_octets && isset($_SERVER['REMOTE_ADDR'])) {
         $num_blocks = $this->ip_octets > 4 ? $this->ip_octets : 4;
         $blocks = explode('.', $_SERVER['REMOTE_ADDR']);
         for ($i = 0; $i < $num_blocks; $i++) {
             $key .= $blocks[$i] . '.';
         }
     }
     return functions::hash($key);
 }
開發者ID:egregor-dev,項目名稱:SatCMS,代碼行數:18,代碼來源:collection.php

示例4: remove_after

$nodes = $sat->get_news_handle();
$sid = $nodes->make_attach_sid();
$id = $nodes->create(['title' => 'Hello', 'attach_sid' => $sid]);
$node = $nodes->get_last_item();
// attach
/** @var SatCMS\Modules\Sat\Classes\Behaviors\ImageAttachs $imagesBehavior */
$imagesBehavior = $node->behavior('Sat.ImageAttachs');
$imageAttachs = $imagesBehavior->get_attachs();
$imageAttachs->create(['pid' => $id, 'title' => $node->id . '|' . functions::hash(microtime(1)), 'ctype_id' => $node->get_ctype_id()]);
class testBehavior extends model_behavior
{
    function remove_after()
    {
        test_assert(!$this->model->behavior('Sat.ImageAttachs')->get_attachs()->count());
    }
}
$node->add_behavior('test.behavior', new testBehavior());
/** @var SatCMS\Modules\Sat\Classes\Behaviors\Commentable $commentsBehavior */
$commentsBehavior = $node->behavior('Sat.Commentable');
$commentAttachs = $commentsBehavior->get_attachs();
for ($i = 0; $i <= 5; $i++) {
    $commentAttachs->create(['pid' => $id, 'comment' => $node->id . '|' . functions::hash(microtime(1)), 'ctype_id' => $node->get_ctype_id()]);
}
$node->remove();
$node = $nodes->load_only_id($id);
test_assert($imagesBehavior->get_attachs()->count() == 0);
$node = $nodes->get_last_item();
test_assert(!$node);
$node = $nodes->alloc();
$node->title = 'Привет Мир';
$node->save();
開發者ID:egregor-dev,項目名稱:SatCMS,代碼行數:31,代碼來源:attachments.php


注:本文中的functions::hash方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。