ianm / flarum-diff
View post edit histories.
Installs: 262
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 5
Open Issues: 0
Type:flarum-extension
Requires
- ext-json: *
- flarum/core: ^1.0.0
- jfcherng/php-diff: ^6.7.1
Suggests
- the-turk/flarum-quiet-edits: Recommended if you want to save storage volume
Conflicts
- dem13n/nickname-changer: >=0.1.0
- the-turk/flarum-edit-notifications: <0.1.4
Replaces
- dev-master
- 3.0.0
- 2.1.0
- 2.0.0-beta.1
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.2.0-beta.1
- 0.1.0-beta.7
- 0.1.0-beta.6
- 0.1.0-beta.5
- 0.1.0-beta.4
- 0.1.0-beta.3
- 0.1.0-beta.2
- 0.1.0-beta.1
- dev-stable1-0
- dev-beta14
- dev-dependabot/npm_and_yarn/js/ini-1.3.8
- dev-dependabot/npm_and_yarn/js/elliptic-6.5.3
- dev-dependabot/npm_and_yarn/js/lodash-4.17.19
- dev-analysis-L3rylk
- dev-beta.7
- dev-beta.6
This package is auto-updated.
Last update: 2021-06-23 19:06:47 UTC
README
This is a temporary maintained fork
I have volunteered to maintain this extension whilst Kylo / the-turk is away. My hope is that this fork can be re-integrated in due course.
~ IanM - December 2020
This extension adds a "post revision history" feature to your Flarum forum. I did this one for my personal Flarum project and decided to share it.
Screenshots:
Features
- Based on jfcherng/php-diff repository (this one is forked from chrisboulton/php-diff since it's no longer maintained).
- Option for line (default), word and char level diffs.
- Three render modes including "Inline", "Side By Side" & "Combined".
- Archive old revisions using cron jobs or manually.
- Delete revisions or rollback to certain revision.
- Supports
fof/nightmode
,the-turk/flarum-quiet-edits
. - Supports all browsers which are supporting css-grid.
Also, it won't load (and cache) anything until you click the "Edited" button so no need to worry about loading times.
Requirements
You can check your php version by running php -v
and check if iconv
is installed by running php --ri iconv
(which should display iconv support => enabled
).
You also need to update s9e/text-formatter
to v2.3.7 for syntax highlighting in "Preview" mode (skip this step if you didn't update flarum/core
to beta 12 yet):
composer update s9e/text-formatter:2.3.7
Conflictions
This extension conflicts with:
-
dem13n/nickname-changer package. Use fof/username-request instead.
-
If you're using the-turk/flarum-edit-notifications, you should update it to v0.1.4
composer update the-turk/flarum-edit-notifications:0.1.4
Installation
Use Bazaar or install manually:
composer require ianm/flarum-diff
Updating
composer update ianm/flarum-diff php flarum migrate php flarum cache:clear
Usage
Enable the extension and set the permissions. You're ready to go!
Archive Old Revisions
If x ≥ A (where the x is post's revision count), first y=mx+b revisions for the post can be stored as merged & compressed BLOB
in a new table (which is called post_edit_histories_archive
). Specify the A, m and b from the settings modal. Float values of y will be rounded to the next lowest integer value. It's recommended to archive old revisions if you want to save storage volume but not recommended if you don't want to.
If you want to archive old revisions, please consider enabling cron job option from the settings modal. I set a weekly cron job which is working on sundays at 02:00 AM (nothing special) using diff:archive
command**. Otherwise, it'll try to find & archive old revisions for the post as soon as Post\Revised
event fires or wait for your php flarum diff:archive
command.
**: Here is the only Cron entry you need to add to your (Linux) server:
* * * * * php /<path/to/flarum>/flarum schedule:run >> /dev/null 2>&1
This Cron will call the Laravel command scheduler every minute. Then, Laravel evaluates your scheduled tasks and runs the tasks that are due.