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

PHP io_readWikiPage函数代码示例

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

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



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

示例1: add_css

 function add_css(&$event, $param)
 {
     // get content from wiki page
     $txt = io_readWikiPage(wikiFN($this->pagename), $this->pagename);
     // filter for CSS definitions in <code css> blocks
     preg_match_all('/<code css>(.*?)<\\/code>/sm', $txt, $matches);
     $usercss = implode("\n", $matches[1]);
     // fix url() locations
     $usercss = preg_replace_callback('#(url\\([ \'"]*)([^\'"]*)#', create_function('$matches', 'global $ID; $m = $matches[2];
                           resolve_mediaid(getNS($ID), $m, $exists);
                           return $matches[1].ml($m);'), $usercss);
     // append all
     $event->data .= $usercss;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:14,代码来源:action.php


示例2: p_cached_instructions

/**
 * Returns the render instructions for a file
 *
 * Uses and creates a serialized cache file
 *
 * @author Andreas Gohr <[email protected]>
 */
function p_cached_instructions($file, $cacheonly = false, $id = '')
{
    global $conf;
    static $run = null;
    if (is_null($run)) {
        $run = array();
    }
    $cache = new cache_instructions($id, $file);
    if ($cacheonly || $cache->useCache() || isset($run[$file])) {
        return $cache->retrieveCache();
    } else {
        if (@file_exists($file)) {
            // no cache - do some work
            $ins = p_get_instructions(io_readWikiPage($file, $id));
            if ($cache->storeCache($ins)) {
                $run[$file] = true;
                // we won't rebuild these instructions in the same run again
            } else {
                msg('Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.', -1);
            }
            return $ins;
        }
    }
    return null;
}
开发者ID:nextghost,项目名称:dokuwiki,代码行数:32,代码来源:parserutils.php


示例3: rawWikiSlices

/**
 * Returns the raw Wiki Text in three slices.
 *
 * The range parameter needs to have the form "from-to"
 * and gives the range of the section in bytes - no
 * UTF-8 awareness is needed.
 * The returned order is prefix, section and suffix.
 *
 * @author Andreas Gohr <[email protected]>
 */
function rawWikiSlices($range, $id, $rev = '')
{
    $text = io_readWikiPage(wikiFN($id, $rev), $id, $rev);
    // Parse range
    list($from, $to) = explode('-', $range, 2);
    // Make range zero-based, use defaults if marker is missing
    $from = !$from ? 0 : $from - 1;
    $to = !$to ? strlen($text) : $to - 1;
    $slices[0] = substr($text, 0, $from);
    $slices[1] = substr($text, $from, $to - $from);
    $slices[2] = substr($text, $to);
    return $slices;
}
开发者ID:nextghost,项目名称:dokuwiki,代码行数:23,代码来源:common.php


示例4: rawWikiSlices

/**
 * Returns the raw Wiki Text in three slices.
 *
 * The range parameter needs to have the form "from-to"
 * and gives the range of the section in bytes - no
 * UTF-8 awareness is needed.
 * The returned order is prefix, section and suffix.
 *
 * @author Andreas Gohr <[email protected]>
 */
function rawWikiSlices($range, $id, $rev = '')
{
    list($from, $to) = split('-', $range, 2);
    $text = io_readWikiPage(wikiFN($id, $rev), $id, $rev);
    if (!$from) {
        $from = 0;
    }
    if (!$to) {
        $to = strlen($text) + 1;
    }
    $slices[0] = substr($text, 0, $from - 1);
    $slices[1] = substr($text, $from - 1, $to - $from);
    $slices[2] = substr($text, $to);
    return $slices;
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:25,代码来源:common.php


示例5: process_page

 function process_page($input)
 {
     $page = $input;
     // integrate all includes
     $includematches = array();
     preg_match_all('/\\[INCLUDE:([^\\]]*)\\]/', $page, $includematches, PREG_SET_ORDER);
     foreach ($includematches as $includematch) {
         $includeid = $includematch[1];
         $file = wikiFN($includeid, '');
         if (@file_exists($file)) {
             $content = io_readWikiPage($file, $includeid);
         }
         if (!$content) {
             $page = str_replace($includematch[0], "include \"{$includeid}\" not found", $page);
             continue;
         }
         $page = str_replace($includematch[0], $content, $page);
     }
     $page = str_replace('~~TEMPLATE~~', '', $page);
     // interpret and remove all maps and variable blocks
     $mapblocks = array();
     preg_match_all('/\\[MAPS\\](.*)?\\[ENDMAPS\\]/sm', $page, $mapblocks, PREG_SET_ORDER);
     foreach ($mapblocks as $mapblock) {
         fill_map($mapblock[1], $this->maps);
         // at this point, maps are stored as strings, we need to convert them
         foreach (array_keys($this->maps) as $mapname) {
             $list = explode(',', $this->maps[$mapname]);
             $map = array();
             foreach ($list as $field) {
                 if ($pos = strpos($field, '=')) {
                     $map[trim(substr($field, 0, $pos))] = trim(substr($field, $pos + 1));
                 } else {
                     // no key found => append
                     $map[] = trim($field);
                 }
             }
             $this->maps[$mapname] = $map;
         }
         $page = str_replace($mapblock[0], '', $page);
     }
     $variableblocks = array();
     preg_match_all('/\\[VARIABLES\\](.*)?\\[ENDVARIABLES\\]/sm', $page, $variableblocks, PREG_SET_ORDER);
     foreach ($variableblocks as $variableblock) {
         fill_map($variableblock[1], $this->variables);
         $page = str_replace($variableblock[0], '', $page);
     }
     // invoke the substitution
     $this->substitute($page, -1);
     return $page;
 }
开发者ID:Tannin,项目名称:DokuWiki-Plugin-My-Template,代码行数:50,代码来源:action.php


示例6: bootstrap_tpl_get_sidebar

/**
 * Get the sidebar html. Get cached sidebar if $cache param is true.
 *
 * @author Cameron Little <[email protected]>
 */
function bootstrap_tpl_get_sidebar($pageid, $cache)
{
    global $TOC;
    $oldtoc = $TOC;
    $html = '';
    $rev = '';
    $file = wikiFN($pageid, $rev);
    if ($cache && !$rev) {
        if (@file_exists($file)) {
            $html = p_cached_output($file, 'xhtml', $pageid);
        }
    } else {
        if (@file_exists($file)) {
            $html = p_render('xhtml', p_get_instructions(io_readWikiPage($file, $pageid, $rev)), $info);
            //no caching on old revisions
        }
    }
    return $html;
}
开发者ID:projectesIF,项目名称:Ateneu,代码行数:24,代码来源:tpl_functions.php


示例7: parse

 /**
  *
  */
 private function parse()
 {
     $text = io_readWikiPage($this->fileName, $this->id);
     $call = p_cached_instructions($this->fileName);
     $calls = count($call);
     for ($c = 0; $c < $calls; $c++) {
         if ($call[$c][0] == 'table_open') {
             $c = $this->parseTable($call, $calls, $c, $text);
         } elseif ($call[$c][0] == 'code') {
             $this->parseCode($call[$c]);
         } elseif ($call[$c][0] == 'plugin' && $call[$c][1][0] == 'data_entry') {
             $this->parseDataEntry($call[$c][1][1]);
         }
     }
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:18,代码来源:database.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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