Skip to content
Snippets Groups Projects
Commit 7de86af9 authored by Gerrit Uitslag's avatar Gerrit Uitslag
Browse files

phpdocs, reformatting

parent aff13b5a
No related branches found
No related tags found
No related merge requests found
......@@ -849,18 +849,17 @@ abstract class ChangeLog {
public function isCurrentRevision($rev) {
return $rev == @filemtime($this->getFilename());
}
/**
* Return an existing revision for a specific date which is
* Return an existing revision for a specific date which is
* the current one or younger or equal then the date
*
* @param string $id
* @param number $date_at timestamp
* @return string revision ('' for current)
*/
function getLastRevisionAt($date_at){
//requested date_at(timestamp) younger or equal then modified_time($this->id) => load current
if($date_at >= @filemtime($this->getFilename())) {
if($date_at >= @filemtime($this->getFilename())) {
return '';
} else if ($rev = $this->getRelativeRevision($date_at+1, -1)) { //+1 to get also the requested date revision
return $rev;
......@@ -1049,6 +1048,12 @@ class MediaChangelog extends ChangeLog {
*
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
*
* @param string $id
* @param int $rev
* @param int $chunk_size
* @param bool $media
* @return array|bool
*/
function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
dbg_deprecated('class PageChangeLog or class MediaChangelog');
......
......@@ -243,7 +243,6 @@ function sectionID($title,&$check) {
return $title;
}
/**
* Wiki page existence check
*
......@@ -251,9 +250,10 @@ function sectionID($title,&$check) {
*
* @author Chris Smith <chris@jalakai.co.uk>
*
* @param string $id page id
* @param string|int $rev empty or revision timestamp
* @param bool $clean flag indicating that $id should be cleaned (see wikiFN as well)
* @param string $id page id
* @param string|int $rev empty or revision timestamp
* @param bool $clean flag indicating that $id should be cleaned (see wikiFN as well)
* @param bool $date_at
* @return bool exists?
*/
function page_exists($id,$rev='',$clean=true, $date_at=false) {
......@@ -489,9 +489,11 @@ function resolve_id($ns,$id,$clean=true){
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $ns namespace which is context of id
* @param string &$page (reference) relative media id, updated to resolved id
* @param bool &$exists (reference) updated with existance of media
* @param string $ns namespace which is context of id
* @param string &$page (reference) relative media id, updated to resolved id
* @param bool &$exists (reference) updated with existance of media
* @param int|string $rev
* @param bool $date_at
*/
function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
$page = resolve_id($ns,$page);
......@@ -502,7 +504,7 @@ function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
$rev = $medialog_rev;
}
}
$file = mediaFN($page,$rev);
$exists = file_exists($file);
}
......@@ -512,9 +514,11 @@ function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $ns namespace which is context of id
* @param string &$page (reference) relative page id, updated to resolved id
* @param bool &$exists (reference) updated with existance of media
* @param string $ns namespace which is context of id
* @param string &$page (reference) relative page id, updated to resolved id
* @param bool &$exists (reference) updated with existance of media
* @param string $rev
* @param bool $date_at
*/
function resolve_pageid($ns,&$page,&$exists,$rev='',$date_at=false ){
global $conf;
......
......@@ -121,15 +121,21 @@ function p_cached_output($file, $format='xhtml', $id='') {
$cache = new cache_renderer($id, $file, $format);
if ($cache->useCache()) {
$parsed = $cache->retrieveCache(false);
if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- cachefile {$cache->cache} used -->\n";
if($conf['allowdebug'] && $format=='xhtml') {
$parsed .= "\n<!-- cachefile {$cache->cache} used -->\n";
}
} else {
$parsed = p_render($format, p_cached_instructions($file,false,$id), $info);
if ($info['cache'] && $cache->storeCache($parsed)) { // storeCache() attempts to save cachefile
if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- no cachefile used, but created {$cache->cache} -->\n";
if($conf['allowdebug'] && $format=='xhtml') {
$parsed .= "\n<!-- no cachefile used, but created {$cache->cache} -->\n";
}
}else{
$cache->removeCache(); //try to delete cachefile
if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- no cachefile used, caching forbidden -->\n";
if($conf['allowdebug'] && $format=='xhtml') {
$parsed .= "\n<!-- no cachefile used, caching forbidden -->\n";
}
}
}
......@@ -616,8 +622,9 @@ function p_sort_modes($a, $b){
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $mode
* @param array|null|false $instructions
* @param array $info returns render info like enabled toc and cache
* @param array|null|false $instructions
* @param array $info returns render info like enabled toc and cache
* @param string $date_at
* @return null|string rendered output
*/
function p_render($mode,$instructions,&$info,$date_at=''){
......@@ -632,7 +639,7 @@ function p_render($mode,$instructions,&$info,$date_at=''){
if($date_at) {
$Renderer->date_at = $date_at;
}
$Renderer->smileys = getSmileys();
$Renderer->entities = getEntities();
$Renderer->acronyms = getAcronyms();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment