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


PHP NoCache函数代码示例

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


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

示例1: SetProperty

function SetProperty($pagename, $prop, $value, $sep = NULL) {
  global $PCache, $KeepToken;
  NoCache();
  $prop = "=p_$prop";
  $value = preg_replace("/$KeepToken(\\d.*?)$KeepToken/e", 
                        "\$GLOBALS['KPV']['$1']", $value);
  if (!is_null($sep) && isset($PCache[$pagename][$prop]))
    $value = $PCache[$pagename][$prop] . $sep . $value;
  $PCache[$pagename][$prop] = $value;
  return $value;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:11,代码来源:pmwiki.php

示例2: PageListSort

function PageListSort(&$list, &$opt, $pn, &$page) {
  global $PageListSortCmp, $PCache, $PageListSortRead;
  SDVA($PageListSortRead, array('name' => 0, 'group' => 0, 'random' => 0,
    'title' => 0));

  switch ($opt['=phase']) {
    case PAGELIST_PRE:
      $ret = 0;
      foreach(preg_split('/[\\s,|]+/', @$opt['order'], -1, PREG_SPLIT_NO_EMPTY) 
              as $o) {
        $ret |= PAGELIST_POST;
        $r = '+';
        if ($o{0} == '-') { $r = '-'; $o = substr($o, 1); }
        $opt['=order'][$o] = $r;
        if ($o{0} != '$' && 
            (!isset($PageListSortRead[$o]) || $PageListSortRead[$o]))
          $ret |= PAGELIST_ITEM;
      }
      StopWatch(@"PageListSort pre ret=$ret order={$opt['order']}");
      return $ret;

    case PAGELIST_ITEM:
      if (!$page) { $page = ReadPage($pn, READPAGE_CURRENT); $opt['=readc']++; }
      return 1;
  }

  ## case PAGELIST_POST
  StopWatch('PageListSort begin');
  $order = $opt['=order'];
  if (@$order['title'])
    foreach($list as $pn) $PCache[$pn]['=title'] = PageVar($pn, '$Title');
  if (@$order['group'])
    foreach($list as $pn) $PCache[$pn]['group'] = PageVar($pn, '$Group');
  if (@$order['random']) 
    { NoCache(); foreach($list as $pn) $PCache[$pn]['random'] = rand(); }
  foreach(preg_grep('/^\\$/', array_keys($order)) as $o) 
    foreach($list as $pn) 
      $PCache[$pn][$o] = PageVar($pn, $o);
  $code = '';
  foreach($opt['=order'] as $o => $r) {
    if (@$PageListSortCmp[$o]) 
      $code .= "\$c = {$PageListSortCmp[$o]}; "; 
    else 
      $code .= "\$c = @strcasecmp(\$PCache[\$x]['$o'],\$PCache[\$y]['$o']); ";
    $code .= "if (\$c) return $r\$c;\n";
  }
  StopWatch('PageListSort sort');
  if ($code) 
    uasort($list,
           create_function('$x,$y', "global \$PCache; $code return 0;"));
  StopWatch('PageListSort end');
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:52,代码来源:pagelist.php

示例3: CondDate

function CondDate($condparm)
{
    global $Now;
    if (!preg_match('/^(\\S*?)(\\.\\.(\\S*))?(\\s+\\S.*)?$/', trim($condparm), $match)) {
        return false;
    }
    if ($match[4] == '') {
        $x0 = $Now;
        NoCache();
    } else {
        list($x0, $x1) = DRange($match[4]);
    }
    if ($match[1] > '') {
        list($t0, $t1) = DRange($match[1]);
        if ($x0 < $t0) {
            return false;
        }
        if ($match[2] == '' && $x0 >= $t1) {
            return false;
        }
    }
    if ($match[3]) {
        list($t0, $t1) = Drange($match[3]);
        if ($x0 >= $t1) {
            return false;
        }
    }
    return true;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:29,代码来源:stdmarkup.php

示例4: CondDate

function CondDate($condparm)
{
    global $Now;
    NoCache();
    if (!preg_match('/^(.*?)(\\.\\.(.*))?$/', $condparm, $match)) {
        return false;
    }
    if ($match[2]) {
        $t0 = $match[1];
        if ($t0 == '') {
            $t0 = '19700101';
        }
        $t1 = $match[3];
        if ($t1 == '') {
            $t1 = '20380101';
        }
    } else {
        $t0 = $t1 = $match[1];
    }
    $t0 = preg_replace('/\\D/', '', $t0);
    if (!preg_match('/^(\\d{4})(\\d\\d)(\\d\\d)$/', $t0, $m)) {
        return false;
    }
    $g0 = mktime(0, 0, 0, $m[2], $m[3], $m[1]);
    if ($Now < $g0) {
        return false;
    }
    $t1 = preg_replace('/\\D/', '', $t1);
    $t1++;
    if (!preg_match('/^(\\d{4})(\\d\\d)(\\d\\d)$/', $t1, $m)) {
        return false;
    }
    $g1 = mktime(0, 0, 0, $m[2], $m[3], $m[1]);
    if ($Now >= $g1) {
        return false;
    }
    return true;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:38,代码来源:stdmarkup.php

示例5: SetProperty

function SetProperty($pagename, $prop, $value, $sep = NULL, $keep = NULL)
{
    global $PCache, $KeepToken;
    NoCache();
    $prop = "=p_{$prop}";
    $value = preg_replace("/{$KeepToken}(\\d.*?){$KeepToken}/e", "\$GLOBALS['KPV']['\$1']", $value);
    if (!is_null($sep) && isset($PCache[$pagename][$prop])) {
        $value = $PCache[$pagename][$prop] . $sep . $value;
    }
    if (is_null($keep) || !isset($PCache[$pagename][$prop])) {
        $PCache[$pagename][$prop] = $value;
    }
    return $PCache[$pagename][$prop];
}
开发者ID:prometheus-ev,项目名称:promwiki,代码行数:14,代码来源:pmwiki.php


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