Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ActivityLog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ots
MediaWiki
ActivityLog
Commits
1805846c
Commit
1805846c
authored
4 years ago
by
Yaxel Perez
Browse files
Options
Downloads
Patches
Plain Diff
Update documentation on how to configure hooks
In reference to issue
#1
parent
94e5ca04
No related branches found
No related tags found
1 merge request
!2
Show more information about who did what and when
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+12
-16
12 additions, 16 deletions
README.md
with
12 additions
and
16 deletions
README.md
+
12
−
16
View file @
1805846c
...
...
@@ -8,30 +8,26 @@ at `Special:Log`.
*
Download and place the file(s) in a directory called ActivityLog in your extensions/ folder
*
Add the following line to your LocalSettings.php
```
```
php
wfLoadExtension
(
'ActivityLog'
);
```
## Usage
Enable through adding to the
`$wgActivityLogHooksToWatch`
global variable,
then viewing through the Special:Log page.
The page title, hook name, and user are logged to the main Log page.
## Parameters
Configure new hooks by adding them to the
`$wgActivityLogHooksToWatch`
array in
LocalSettings.php.
*
`$wgActivityLogHooksToWatch`
- The hooks to watch
Update by setting the key in the associative array to true, for any hook.
For example, you can log user logins via:
```
php
$wgActivityLogHooksToWatch
[
"UserLoginComplete"
]
```
php
$wgActivityLogHooksToWatch
[
'ArticleViewHeader'
]
=
function
(
$article
)
{
return
'Visited article "'
.
$article
->
getTitle
()
.
'"'
;
};
```
All the normal arguments that would be passed to those hook executions are
discarded.
`$wgActivityLogHooksToWatch`
takes booleans, strings, and anonymous functions. A
`true`
value will log the hook name, A string will log the string itself, and a
callback will be invoked with all the arguments that are passed by the hook.
[
https://www.mediawiki.org/wiki/Manual:Hooks
](
https://www.mediawiki.org/wiki/Manual:Hooks
)
## Internationalization
...
...
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