Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
7de86af9
Commit
7de86af9
authored
9 years ago
by
Gerrit Uitslag
Browse files
Options
Downloads
Patches
Plain Diff
phpdocs, reformatting
parent
aff13b5a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inc/changelog.php
+9
-4
9 additions, 4 deletions
inc/changelog.php
inc/pageutils.php
+15
-11
15 additions, 11 deletions
inc/pageutils.php
inc/parserutils.php
+13
-6
13 additions, 6 deletions
inc/parserutils.php
with
37 additions
and
21 deletions
inc/changelog.php
+
9
−
4
View file @
7de86af9
...
...
@@ -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'
);
...
...
This diff is collapsed.
Click to expand it.
inc/pageutils.php
+
15
−
11
View file @
7de86af9
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
inc/parserutils.php
+
13
−
6
View file @
7de86af9
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment