本文整理汇总了PHP中metaFN函数的典型用法代码示例。如果您正苦于以下问题:PHP metaFN函数的具体用法?PHP metaFN怎么用?PHP metaFN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了metaFN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
foreach ($this->ids as $id) {
saveWikiText($id, '', 'deleted in tearDown()');
@unlink(metaFN($id, '.meta'));
}
}
开发者ID:houshuang,项目名称:folders2web,代码行数:7,代码来源:nested_include.test.php
示例2: handle
/**
* Handle the match
*/
function handle($match, $state, $pos, &$handler)
{
global $ID;
global $ACT;
// don't show linkback section on blog mainpages
if (defined('IS_BLOG_MAINPAGE')) {
return false;
}
// don't allow usage of syntax in comments
if (isset($_REQUEST['comment'])) {
return false;
}
// get linkback meta file name
$file = metaFN($ID, '.linkbacks');
$data = array('send' => false, 'receive' => false, 'display' => false, 'sentpings' => array(), 'receivedpings' => array(), 'number' => 0);
if (@file_exists($file)) {
$data = unserialize(io_readFile($file, false));
}
if ($match == '~~LINKBACK~~') {
$data['receive'] = true;
$data['display'] = true;
} else {
if ($match == '~~LINKBACK:off~~') {
$data['receive'] = false;
$data['display'] = false;
} else {
$data['receive'] = false;
$data['display'] = true;
}
}
io_saveFile($file, serialize($data));
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:35,代码来源:syntax.php
示例3: handle
/**
* Handle the match
*/
function handle($match, $state, $pos, &$handler)
{
global $ID, $ACT;
// strip markup
$match = substr($match, 12, -2);
// split title (if there is one)
list($match, $title) = explode('|', $match, 2);
// assign discussion state
if ($match == ':off') {
$status = 0;
} else {
if ($match == ':closed') {
$status = 2;
} else {
$status = 1;
}
}
if ($ACT == 'preview') {
return;
}
// get discussion meta file name
$file = metaFN($ID, '.comments');
$data = array();
if (@file_exists($file)) {
$data = unserialize(io_readFile($file, false));
}
$data['title'] = $title;
$data['status'] = $status;
io_saveFile($file, serialize($data));
return $status;
}
开发者ID:NikolausL,项目名称:plugin-discussion,代码行数:34,代码来源:comments.php
示例4: handle_approve
function handle_approve(&$event, $param)
{
global $ID, $REV, $INFO;
if ($event->data == 'show' && isset($_GET['approve'])) {
if (!$this->can_approve()) {
return;
}
//change last commit comment to Approved
$meta = p_read_metadata($ID);
$meta[current][last_change][sum] = $meta[persistent][last_change][sum] = APPROVED;
$meta[current][last_change][user] = $meta[persistent][last_change][user] = $INFO[client];
if (!array_key_exists($INFO[client], $meta[current][contributor])) {
$meta[current][contributor][$INFO[client]] = $INFO[userinfo][name];
$meta[persistent][contributor][$INFO[client]] = $INFO[userinfo][name];
}
p_save_metadata($ID, $meta);
//update changelog
//remove last line from file
$changelog_file = metaFN($ID, '.changes');
$changes = file($changelog_file, FILE_SKIP_EMPTY_LINES);
$lastLogLine = array_pop($changes);
$info = parseChangelogLine($lastLogLine);
$info[user] = $INFO[client];
$info[sum] = APPROVED;
$logline = implode("\t", $info) . "\n";
array_push($changes, $logline);
io_saveFile($changelog_file, implode('', $changes));
header('Location: ?id=' . $ID);
}
}
开发者ID:vincentkersten,项目名称:dokuwiki-plugin-approve,代码行数:30,代码来源:approve.php
示例5: __construct
function __construct()
{
$ip = $_SERVER['REMOTE_ADDR'];
if ($this->is_excluded($ip, true)) {
exit("403: Not Available");
}
$this->ipaddr = $ip;
$today = getdate();
$ns_prefix = "quickstats:";
$ns = $ns_prefix . $today['mon'] . '_' . $today['year'] . ':';
$this->page_file = metaFN($ns . 'pages', '.ser');
$this->ua_file = metaFN($ns . 'ua', '.ser');
$this->ip_file = metaFN($ns . 'ip', '.ser');
$this->misc_data_file = metaFN($ns . 'misc_data', '.ser');
$this->qs_file = metaFN($ns . 'qs_data', '.ser');
$this->page_users_file = metaFN($ns . 'page_users', '.ser');
$this->page_totals_file = metaFN($ns_prefix . 'page_totals', '.ser');
$this->year_month = $today['mon'] . '_' . $today['year'];
if (preg_match('/WINNT/i', PHP_OS)) {
$this->SEP = '\\';
}
$this->show_date = $this->getConf('show_date');
$this->dw_tokens = array('do', 'sectok', 'page', 's[]', 'id', 'rev', 'idx');
$conf_tokens = $this->getConf('xcl_name_val');
if (!empty($conf_tokens)) {
$conf_tokens = explode(',', $conf_tokens);
if (!empty($conf_tokens)) {
$this->dw_tokens = array_merge($this->dw_tokens, $conf_tokens);
}
}
$this->helper = $this->loadHelper('quickstats', true);
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:32,代码来源:action.php
示例6: __construct
function __construct()
{
$this->script_file = metaFN('epub:cache', '.ser');
$this->cache = unserialize(io_readFile($this->script_file, false));
if (!$this->cache) {
$this->cache = array();
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:8,代码来源:helper.php
示例7: numberingDB
function numberingDB()
{
$db = metaFN("numbering:seqnum", '.ser');
if (!file_exists($db)) {
io_saveFile($db, "", array());
}
return $db;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:8,代码来源:getnum.php
示例8: process_feed
/**
*/
function process_feed(&$event, $param)
{
global $ID;
if ($this->helper->pageUpdated()) {
$metafile = metaFN('newsfeed:wasupdated', '.meta');
io_saveFile($metafile, time() . "\n" . $ID . "\n");
$this->helper->saveFeedData($ID);
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:11,代码来源:action.php
示例9: file
/**
* Return the subscription meta file for the given ID
*
* @author Adrian Lang <[email protected]>
*
* @param string $id The target page or namespace, specified by id; Namespaces
* are identified by appending a colon.
* @return string
*/
protected function file($id)
{
$meta_fname = '.mlist';
if (substr($id, -1, 1) === ':') {
$meta_froot = getNS($id);
$meta_fname = '/' . $meta_fname;
} else {
$meta_froot = $id;
}
return metaFN((string) $meta_froot, $meta_fname);
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:20,代码来源:subscription.php
示例10: subscription_filename
/**
* Get the name of the metafile tracking subscriptions to target page or
* namespace
*
* @param string $id The target page or namespace, specified by id; Namespaces
* are identified by appending a colon.
*
* @author Adrian Lang <[email protected]>
*/
function subscription_filename($id)
{
$meta_fname = '.mlist';
if (substr($id, -1, 1) === ':') {
$meta_froot = getNS($id);
if ($meta_froot === false) {
$meta_fname = '/' . $meta_fname;
}
} else {
$meta_froot = $id;
}
return metaFN($meta_froot, $meta_fname);
}
开发者ID:JeromeS,项目名称:dokuwiki,代码行数:22,代码来源:subscription.php
示例11: epub_get_progress_dir
function epub_get_progress_dir($temp_user = null)
{
static $dir;
$seed = md5(rawurldecode($_POST['user']) . time());
if (!$dir) {
if (isset($_POST['client'])) {
$user = rawurldecode($_POST['client']) . ":{$seed}";
} else {
$user = $temp_user ? "{$temp_user}:{$seed}" : $seed;
}
$dir = dirname(metaFN("epub:{$user}:tmp", '.meta')) . '/';
}
return $dir;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:14,代码来源:check_progess.php
示例12: handle_dokuwiki_started
public function handle_dokuwiki_started(&$event, $param)
{
global $ID, $ACT, $REV;
if ($ACT != 'show' && $ACT != '' || $REV) {
return;
}
$page = p_get_metadata($ID, 'relation isreplacedby');
// return if no redirection data
if (empty($page)) {
return;
}
if (isset($_GET['redirect'])) {
// return if redirection is temporarily disabled,
// or we have been redirected 5 times in a row
if ($_GET['redirect'] == 'no' || $_GET['redirect'] > 4) {
return;
} elseif ($_GET['redirect'] > 0) {
$redirect = $_GET['redirect'] + 1;
} else {
$redirect = 1;
}
} else {
$redirect = 1;
}
// verify metadata currency
if (@filemtime(metaFN($ID, '.meta')) < @filemtime(wikiFN($ID))) {
return;
}
// preserve #section from $page
list($page, $section) = explode('#', $page, 2);
if (isset($section)) {
$section = '#' . $section;
} else {
$section = '';
}
// prepare link for internal redirects, keep external targets
if (!preg_match('#^https?://#i', $page)) {
$page = wl($page, array('redirect' => $redirect), TRUE, '&');
if (!headers_sent() && $this->getConf('show_note')) {
// remember to show note about being redirected from another page
session_start();
$_SESSION[DOKU_COOKIE]['redirect'] = $ID;
}
}
// redirect
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $page . $section . $_SERVER['QUERY_STRING']);
exit;
}
开发者ID:phillip-hopper,项目名称:dokuwiki-plugin-pageredirect,代码行数:49,代码来源:action.php
示例13: _index
function _index($id)
{
global $INDEXER;
global $CLEAR;
global $QUIET;
// if not cleared only update changed and new files
if ($CLEAR) {
$idxtag = metaFN($id, '.indexed');
if (@file_exists($idxtag)) {
@unlink($idxtag);
}
}
_quietecho("{$id}... ");
idx_addPage($id, !$QUIET);
_quietecho("done.\n");
}
开发者ID:rezlemic,项目名称:dokuwiki-jQuery,代码行数:16,代码来源:indexer.php
示例14: search_discussionpages
/**
* function for the search callback
*/
function search_discussionpages(&$data, $base, $file, $type, $lvl, $opts)
{
global $conf;
if ($type == 'd') {
return true;
}
// recurse into directories
if (!preg_match('#' . preg_quote('/' . DISCUSSION_NS . '/', '#') . '#u', $file)) {
return false;
}
if (!preg_match('#\\.txt$#', $file)) {
return false;
}
$id = pathID(str_replace(DISCUSSION_NS . '/', '', $file));
$data[] = array('id' => $id, 'old' => $conf['datadir'] . $file, 'new' => metaFN($id, '.comments'));
return true;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:20,代码来源:convert.php
示例15: handle_pageredirect_redirect
function handle_pageredirect_redirect(&$event, $param) {
global $ID, $ACT, $REV;
if (($ACT == 'show' || $ACT == '') && empty($REV)) {
$page = p_get_metadata($ID,'relation isreplacedby');
// return if no redirection data
if (empty($page)) { return; }
if (isset($_GET['redirect'])) {
// return if redirection is temporarily disabled,
// or we have been redirected 5 times in a row
if ($_GET['redirect'] == 'no' || $_GET['redirect'] > 4) { return; }
elseif ($_GET['redirect'] > 0) { $redirect = $_GET['redirect'] +1; }
else { $redirect = 1; }
} else {
$redirect = 1;
}
// verify metadata currency
if (@filemtime(metaFN($ID,'.meta')) < @filemtime(wikiFN($ID))) { return; }
if (!headers_sent() && $this->getConf('show_note')) {
// remember to show note about being redirected from another page
session_start();
$_SESSION[DOKU_COOKIE]['redirect'] = $ID;
}
// preserve #section from $page
list($page, $section) = explode('#', $page, 2);
if (isset($section)) {
$section = '#' . $section;
} else {
$section = '';
}
// redirect
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".wl($page, Array('redirect' => $redirect), TRUE, '&'). $section);
exit();
}
}
开发者ID:neutrinog,项目名称:Door43,代码行数:42,代码来源:action.php
示例16: render
/**
* Create output
*/
function render($mode, &$renderer, $data)
{
if (empty($data)) {
return false;
}
global $ID;
if ($mode == 'xhtml') {
list($state, $match) = $data;
switch ($state) {
case DOKU_LEXER_SPECIAL:
$this->helper->setUpdate($match);
$metafile = metaFN('newsfeed:timestamp', '.meta');
io_saveFile($metafile, time());
$renderer->doc .= "";
break;
}
return true;
}
return false;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:23,代码来源:feed.php
示例17: handle_pageredirect_redirect
function handle_pageredirect_redirect(&$event, $param)
{
global $ID, $ACT, $REV;
if (($ACT == 'show' || $ACT == '') && empty($REV)) {
$page = p_get_metadata($ID, 'relation isreplacedby');
// return if no redirection data
if (empty($page)) {
return;
}
if (isset($_GET['redirect'])) {
// return if redirection is temporarily disabled,
// or we have been redirected 5 times in a row
if ($_GET['redirect'] == 'no' || $_GET['redirect'] > 4) {
return;
} elseif ($_GET['redirect'] > 0) {
$redirect = $_GET['redirect'] + 1;
} else {
$redirect = 1;
}
} else {
$redirect = 1;
}
// verify metadata currency
if (@filemtime(metaFN($ID, '.meta')) < @filemtime(wikiFN($ID))) {
return;
}
if (!headers_sent() && $this->getConf('show_note')) {
// remember to show note about being redirected from another page
session_start();
if (!isset($_SESSION[DOKU_COOKIE]['redirect']) || $redirect == 1) {
$_SESSION[DOKU_COOKIE]['redirect'] = $ID;
}
}
// redirect
resolve_pageid(getNS($ID), $page, $exists);
header("Location: " . wl($page, array('redirect' => $redirect), TRUE, '&'));
exit;
}
}
开发者ID:nefercheprure,项目名称:dokuwiki-plugin-pageredirect,代码行数:39,代码来源:action.php
示例18: handle
/**
* Handle the match
*/
function handle($match, $state, $pos, &$handler)
{
global $ID, $ACT, $REV;
// strip markup
$match = substr($match, 12, -2);
// split title (if there is one)
list($match, $title) = explode('|', $match, 2);
// assign discussion state
if ($match == ':off') {
$status = 0;
} else {
if ($match == ':closed') {
$status = 2;
} else {
$status = 1;
}
}
if ($ACT == 'preview' || $REV) {
return false;
}
// get discussion meta file name
$file = metaFN($ID, '.comments');
$data = array();
if (@file_exists($file)) {
$data = unserialize(io_readFile($file, false));
}
// only save when the status or title was actually changed, the timestamp of the .comments file is used
// as sorting criteria for the threads view!
// note that isset can't be used for the first test as isset returns false for NULL values!
if (!array_key_exists('title', $data) || $data['title'] !== $title || !isset($data['status']) || $data['status'] !== $status) {
$data['title'] = $title;
$data['status'] = $status;
io_saveFile($file, serialize($data));
}
return $status;
}
开发者ID:neutrinog,项目名称:Door43,代码行数:39,代码来源:comments.php
示例19: p_read_metadata
/**
* read the metadata from source/cache for $id
* (internal use only - called by p_get_metadata & p_set_metadata)
*
* this function also converts the metadata from the original format to
* the current format ('current' & 'persistent' arrays)
*
* @author Christopher Smith <[email protected]>
*
* @param string $id absolute wiki page id
* @param bool $cache whether or not to cache metadata in memory
* (only use for metadata likely to be accessed several times)
*
* @return array metadata
*/
function p_read_metadata($id, $cache = false)
{
global $cache_metadata;
if (isset($cache_metadata[(string) $id])) {
return $cache_metadata[(string) $id];
}
$file = metaFN($id, '.meta');
$meta = @file_exists($file) ? unserialize(io_readFile($file, false)) : array('current' => array(), 'persistent' => array());
// convert $meta from old format to new (current+persistent) format
if (!isset($meta['current'])) {
$meta = array('current' => $meta, 'persistent' => $meta);
// remove non-persistent keys
unset($meta['persistent']['title']);
unset($meta['persistent']['description']['abstract']);
unset($meta['persistent']['description']['tableofcontents']);
unset($meta['persistent']['relation']['haspart']);
unset($meta['persistent']['relation']['references']);
unset($meta['persistent']['date']['valid']);
if (empty($meta['persistent']['description'])) {
unset($meta['persistent']['description']);
}
if (empty($meta['persistent']['relation'])) {
unset($meta['persistent']['relation']);
}
if (empty($meta['persistent']['date'])) {
unset($meta['persistent']['date']);
}
// save converted metadata
io_saveFile($file, serialize($meta));
}
if ($cache) {
$cache_metadata[(string) $id] = $meta;
}
return $meta;
}
开发者ID:Harvie,项目名称:dokuwiki,代码行数:50,代码来源:parserutils.php
示例20: registerOnLoad
function registerOnLoad($js)
{
global $ID;
global $lang;
global $skip_styling;
$preview_button = $lang['btn_preview'];
$ckgedit_conf_direction = $this->getConf('direction');
if ($ckgedit_conf_direction == "dokuwiki") {
$ckgedit_lang_direction = $lang['direction'];
} else {
$ckgedit_lang_direction = $ckgedit_conf_direction;
}
$ImageUploadAllowedExtensions = $this->get_ckgedit_ImageAllowedExtensions();
$media_tmp_ns = preg_match('/:/', $ID) ? preg_replace('/:\\w+$/', "", $ID, 1) : "";
$locktimer_msg = "Your lock for editing this page is about to expire in a minute.\\n" . "You can reset the timer by clicking the Back-up button.";
$meta_fn = metaFN($ID, '.ckgedit');
$meta_id = 'meta/' . str_replace(':', '/', $ID) . '.ckgedit';
global $INFO;
global $conf;
global $USERINFO;
$_OS = strtolower(PHP_OS);
$cname = getCacheName($INFO['client'] . $ID, '.draft');
$useheading = $conf['useheading'];
if ($useheading && $useheading != 'content' && $useheading != '0') {
$useheading = 'y';
} else {
$useheading = 'n';
}
//msg('uh='.$useheading);
$open_upload = $this->getConf('open_upload');
$editor_backup = $this->getConf('editor_bak');
$create_folder = $this->getConf('create_folder');
$interface_lang = $this->getConf('other_lang');
$scayt_lang = $this->getConf('scayt_lang');
list($name, $scayt_lang) = explode('/', $scayt_lang);
$scayt_auto = $this->getConf('scayt_auto');
$color_opts = $this->getConf('color_options');
$font_opts = $this->getConf('font_options');
$toolbar_opts = $this->getConf('alt_toolbar');
$mfiles = $this->getConf('mfiles');
if (!isset($INFO['userinfo']) && !$open_upload) {
$user_type = 'visitor';
} else {
$user_type = 'user';
}
$save_dir = DOKU_URL . ltrim($conf['savedir'], '/.\\/');
// if no ACL is used always return upload rights
if ($conf['useacl']) {
$client = $_SERVER['REMOTE_USER'];
} else {
$client = "";
}
$user_name = $USERINFO['name'];
$user_email = $USERINFO['mail'];
$fnencode = isset($conf['fnencode']) ? $conf['fnencode'] : 'url';
$user_groups = $USERINFO['grps'];
if (!$user_groups) {
$user_groups = array();
}
if (@in_array("guest", $user_groups)) {
$create_folder = 'n';
$user_type = 'visitor';
}
$user_groups = implode(";;", $user_groups);
if ($INFO['isadmin'] || $INFO['ismanager']) {
$client = "";
}
$ver_anteater = mktime(0, 0, 0, 11, 7, 2010);
$dwiki_version = mktime(0, 0, 0, 01, 01, 2008);
if (isset($conf['fnencode'])) {
$ver_anteater = mktime(0, 0, 0, 11, 7, 2010);
$dwiki_version = mktime(0, 0, 0, 11, 7, 2010);
} else {
if (function_exists('getVersionData')) {
$verdata = getVersionData();
if (isset($verdata) && preg_match('/(\\d+)-(\\d+)-(\\d+)/', $verdata['date'], $ver_date)) {
if ($ver_date[1] >= 2005 && ($ver_date[3] > 0 && $ver_date[3] < 31) && ($ver_date[2] > 0 && $ver_date[2] <= 12)) {
// month day year
$dwiki_version = @mktime(0, 0, 0, $ver_date[2], $ver_date[3], $ver_date[1]);
if (!$dwiki_version) {
$dwiki_version = mktime(0, 0, 0, 01, 01, 2008);
}
$ver_anteater = mktime(0, 0, 0, 11, 7, 2010);
}
}
}
}
$default_fb = $this->getConf('default_fb');
if ($default_fb == 'none') {
$client = "";
}
$doku_base = DOKU_BASE;
return <<<end_of_string
<script type='text/javascript'>
//<![CDATA[
if(window.dw_locktimer) {
var locktimer = dw_locktimer;
//.........这里部分代码省略.........
开发者ID:violetfish,项目名称:ckgedit,代码行数:101,代码来源:helper.php
注:本文中的metaFN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论