Download the PHP package zephir/kirby-contentsync without Composer

On this page you can find all versions of the php package zephir/kirby-contentsync. 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-contentsync

Kirby Contentsync plugin

Tired of manual and cumbersome methods like git push/pull, scp, rsync, or sftp to synchronize content between your server and local development environment?
Embrace a seamless and efficient syncing solution with Contentsync.

This plugin requires Kirby 3/4, Kirby CLI and PHP 8 or higher to work.

Table of Contents

1. Installation

The recommended way of installing is by using Composer.

1.1 Composer

1.2 Download

Download and copy this repository to /site/plugins/kirby-contentsync.

1.3 Git submodule

2. Setup

After installation, you simply have to configure the the Kirby command.

3. Options

Option Type Default Required Description
source string null Source of the content, normally the staging/prod server. URL of the host (e.g. https://getkirby.com)
token string null The authentication token, make sure this token is not accessible by the public. Either use an env file/variable or use a private git repository.
enabledRoots array see below Which roots should be synchronized by the plugin. You can see all available roots here.

3.1 enabledRoots

To support different types of folder structures we use the kirby()->roots() function (hence the name of the option). The plugin supports synchronizing all Kirby root paths. By default, the plugin is configured to sync the accounts and content roots.

3.2 Example config entry

4. Usage

Kirby CLI Command:

kirby content:sync

With verbose logging:

kirby content:sync -v

5. How does it work?

The plugin creates 2 endpoints (routes):

  1. /contentsync/files: Returns a list of all files in the enabled roots.
  2. /contentsync/file/:fileId: Returns the contents of the requested file.

If you don't set up a token the endpoints won't work.

Each file returned by files has an ID (sha1 hash of root name + path), a path (relative to Kirby root), a Kirby root name, and a checksum of the file contents.

The plugin compares the retrieved file list with a file list of local files. It automatically deletes local files that aren't in the server list, creates the ones that aren't local but in the server list, and updates the ones with different checksums.

It doesn't sync files that haven't changed.

6. Caveats

  1. Since we download each file individually, it is possible that a WAF / Firewall will block the requests. You can add an exception for the endpoints.
  2. Generating the checksum can put a bit of load on the server, especially for large files. But for "normal" websites it should be fine - even if you have several gigabytes of data / many files.
  3. Because we serve all files through PHP and a web endpoint, downloads of large files (200MB+) may be stopped by the server hoster (especially with shared hosting).

License

MIT

Credits


All versions of kirby-contentsync with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.2
getkirby/cli Version ^1.1
php-curl-class/php-curl-class Version ^9.19
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 zephir/kirby-contentsync contains the following files

Loading the files please wait ....