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
63dd0d58
Commit
63dd0d58
authored
17 years ago
by
Michael Klier
Browse files
Options
Downloads
Patches
Plain Diff
XMLRPC: added getRecentChanges()
darcs-hash:20080118230312-23886-acd8758fc95eb64788533feca4afd5fbb207c290.gz
parent
6f9bd982
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf/mime.conf
+1
-0
1 addition, 0 deletions
conf/mime.conf
lib/exe/xmlrpc.php
+84
-9
84 additions, 9 deletions
lib/exe/xmlrpc.php
with
85 additions
and
9 deletions
conf/mime.conf
+
1
−
0
View file @
63dd0d58
...
...
@@ -7,6 +7,7 @@ png image/png
tgz
application
/
octet
-
stream
tar
application
/
x
-
gtar
gz
application
/
octet
-
stream
bz2
application
/
octet
-
stream
zip
application
/
zip
rar
application
/
rar
pdf
application
/
pdf
...
...
This diff is collapsed.
Click to expand it.
lib/exe/xmlrpc.php
+
84
−
9
View file @
63dd0d58
...
...
@@ -15,7 +15,6 @@ session_write_close(); //close session
require_once
(
DOKU_INC
.
'inc/IXR_Library.php'
);
/**
* Contains needed wrapper functions and registers all available
* XMLRPC functions.
...
...
@@ -104,10 +103,12 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
array
(
'struct'
,
'string'
),
'Lists all links contained in a wiki page'
);
/*
FIXME: missing, yet
'wiki.getRecentChanges'
*/
$this
->
addCallback
(
'wiki.getRecentChanges'
,
'this:getRecentChanges'
,
array
(
'struct'
,
'int'
),
'Returns a strukt about all recent changes since given timestamp.'
);
$this
->
serve
();
}
...
...
@@ -140,7 +141,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
return
ft_pageLookup
(
''
);
}
/**
* Return a list of backlinks
*/
...
...
@@ -150,7 +150,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
}
/**
*
r
eturn some basic data about a page
*
R
eturn some basic data about a page
*/
function
pageInfo
(
$id
,
$rev
=
''
){
if
(
auth_quickaclcheck
(
$id
)
<
AUTH_READ
){
...
...
@@ -170,11 +170,13 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
'author'
=>
((
$info
[
'user'
])
?
$info
[
'user'
]
:
$info
[
'ip'
]),
'version'
=>
$time
);
return
$data
;
return
(
$data
);
}
/**
* Save a wiki page
* FIXME check ACL !!!
*/
function
putPage
(
$put_id
,
$put_text
,
$put_summary
=
''
,
$put_minor
=
0
,
$put_rev
=
''
,
$put_pre
=
''
,
$put_suf
=
''
)
{
global
$TEXT
;
...
...
@@ -200,6 +202,8 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
/**
* Lists all links contained in a wiki page
*
* @author Michael Klier <chi@chimeric.de>
*/
function
listLinks
(
$id
)
{
if
(
auth_quickaclcheck
(
$id
)
<
AUTH_READ
){
...
...
@@ -241,7 +245,77 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
}
}
return
$links
;
return
(
$links
);
}
/**
* Returns a list of recent changes since give timestamp
*
* @author Michael Klier <chi@chimeric.de>
*/
function
getRecentChanges
(
$timestamp
)
{
global
$conf
;
if
(
strlen
(
$timestamp
)
!=
10
)
return
new
IXR_Error
(
20
,
'The provided value is not a valid timestamp'
);
$changes
=
array
();
require_once
(
DOKU_INC
.
'inc/changelog.php'
);
require_once
(
DOKU_INC
.
'inc/pageutils.php'
);
// read changes
$lines
=
@
file
(
$conf
[
'changelog'
]);
if
(
empty
(
$lines
))
return
new
IXR_Error
(
10
,
'The changelog could not be read'
);
// we start searching at the end of the list
$lines
=
array_reverse
(
$lines
);
// cache seen pages and skip them
$seen
=
array
();
foreach
(
$lines
as
$line
)
{
if
(
empty
(
$line
))
continue
;
// skip empty lines
$logline
=
parseChangelogLine
(
$line
);
if
(
$logline
===
false
)
continue
;
// skip seen ones
if
(
isset
(
$seen
[
$logline
[
'id'
]]))
continue
;
// skip minors
if
(
$logline
[
'type'
]
===
DOKU_CHANGE_TYPE_MINOR_EDIT
&&
(
$flags
&
RECENTS_SKIP_MINORS
))
continue
;
// remember in seen to skip additional sights
$seen
[
$logline
[
'id'
]]
=
1
;
// check if it's a hidden page
if
(
isHiddenPage
(
$logline
[
'id'
]))
continue
;
// check ACL
if
(
auth_quickaclcheck
(
$logline
[
'id'
])
<
AUTH_READ
)
continue
;
// check existance
if
((
!@
file_exists
(
wikiFN
(
$logline
[
'id'
])))
&&
(
$flags
&
RECENTS_SKIP_DELETED
))
continue
;
// check if logline is still in the queried time frame
if
(
$logline
[
'date'
]
>=
$timestamp
)
{
$change
[
'name'
]
=
$logline
[
'id'
];
$change
[
'lastModified'
]
=
$logline
[
'date'
];
$change
[
'author'
]
=
$logline
[
'user'
];
$change
[
'version'
]
=
$logline
[
'date'
];
array_push
(
$changes
,
$change
);
}
else
{
$changes
=
array_reverse
(
$changes
);
return
(
$changes
);
}
}
// in case we still have nothing at this point
return
new
IXR_Error
(
30
,
'There are no changes in the specified timeframe'
);
}
/**
...
...
@@ -255,3 +329,4 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
$server
=
new
dokuwiki_xmlrpc_server
();
// vim:ts=4:sw=4:enc=utf-8:
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