the-turk/flarum-diff 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

the-turk/flarum-diff

最新稳定版本:1.1.2

Composer 安装命令:

composer require the-turk/flarum-diff

包简介

View post edit histories.

README 文档

README

MIT license Latest Stable Version Total Downloads

This extension adds a "post revision history" feature to your Flarum forum.

Screenshots:

Diff Collage

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

php ext-iconv

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).

Installation

composer require the-turk/flarum-diff

Updating

composer update the-turk/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. See this discussion for setting up the scheduler.

Links

统计信息

  • 总下载量: 9.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-10