Download the PHP package tearoom1/kirby-content-watch without Composer

On this page you can find all versions of the php package tearoom1/kirby-content-watch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-content-watch

Content Watch Plugin for Kirby

This plugin tracks all content changes in your Kirby site and adds a panel view that displays those changes. It shows modification date and editor information and the history of changes for each file. This allows you to keep track of what has been changed and who made the changes.

Additionally it provides a view to see which pages are currently locked and by whom.


Features

Known Limitations

This plugin has been developed for rather smaller websites. It has not been tested on big sites or slow servers. It stores all history entries in a single file for each content directory, and goes through them each time you open the plugins page. This may be a problem for sites with a large number of files.

The restore feature also has some limitations

Beware the restore feature is BETA and may have bugs. Use at your own risk!

Installation

Manual

  1. Download or clone this repository
  2. Place the folder kirby-content-watch in /site/plugins/

Composer

Usage

After installation, you'll see a new "Content Watch" item in the Panel menu. Click on it to access:

Each file in the list can be expanded to show its modification history. For each history entry with a snapshot, a restore button is available to revert to that previous version.

Configuration

You can configure the plugin in your config.php:

Option Type Default Description
allowedRoles array [] Additional Kirby roles allowed to use the plugin. Admins always have access (see Access Control)
retentionDays int 30 Number of days to keep history entries before they are pruned
retentionCount int 10 Maximum number of history entries to keep per file
defaultPageSize int 10 Default number of items per page in the panel view. Possible values: 10, 20, 50
layoutStyle string 'default' Layout density of the list. Set to 'compact' for a tighter layout
enableLockedPages bool true Whether to show the locked pages view in the panel
enableRestore bool false Enable content restore functionality. When enabled, full content snapshots are saved — increases disk usage
enableDiff bool false Enable content diff view. Requires enableRestore to be true
disable bool false Completely disable the plugin without uninstalling it

Access Control

By default, only users with the admin role can access the plugin — that includes the Content Watch panel area, the menu entry, the diff API, and the restore API. Non-admins will not see the menu item, and any direct API call returns 403 Forbidden.

To grant access to additional Kirby roles, list them in allowedRoles:

Notes:

How It Works

The plugin creates a .content-watch.json file in each content directory that has been modified. This file stores the history of changes including editor information, timestamps, and content snapshots for restoration (if restore is enabled). History entries are automatically pruned based on your retention settings.

When restore functionality is enabled:

  1. Each time content is changed, a snapshot of the content is saved
  2. You can view and restore previous versions through the interface
  3. When you restore a previous version, the plugin will:
    • Extract the content from the saved snapshot
    • Overwrite the current content file
    • Record this restoration in the history with a reference to the restored version

When restore functionality is disabled:

  1. The plugin only tracks metadata like timestamps and editor information
  2. No content snapshots are stored, reducing disk usage
  3. The restore buttons will not be displayed in the interface

NOTE: The restore functionality only works for page content. It does not track changes of media/binary files. And when restoring a page, it does not restore its files.

Page Method

The plugin exposes a contentHistory() method on all pages, giving you programmatic access to the change history from within templates or plugins.

Each entry is an array with the following keys:

Key Description
version Incrementing version number
time Unix timestamp of the change
editor_id ID of the Kirby user who made the change
type Always page for page content
language Language code (multilang only, requires enableRestore)
content Raw content snapshot (only present when enableRestore is true)

Example: display last editor info

Example: access field values from a snapshot (requires enableRestore: true)

This gives you full Kirby field method access (.html(), .kirbytext(), .value(), etc.) on any historical snapshot.

Diff Generation

If you like to have a more advanced diff, you can install jfcherng/php-diff

This will automatically make use of the advanced diff.

Requirements

Todo

License

This plugin is licensed under the MIT License

Credits


All versions of kirby-content-watch with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tearoom1/kirby-content-watch contains the following files

Loading the files please wait ...