Download the PHP package andyvanee/synchroversion without Composer

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

Synchroversion - File-based, versioning cache system.

Synchroversion is designed with the following properties in mind:

In general, it is built around the assumption that your data is:

Some possible use cases might be:

It does this by storing a log of changes to the content in diff format in a state directory, and the latest few full versions of the file in a latest directory. The producer and consumer are never accessing the same file at the same time.

My initial prototype was written in bash, but this version is in PHP since it's what I'm currently working in. Since the format is completely text file based, it is language agnostic and should be quite simple to implement in other languages as well.

Usage

Install with composer:

new Synchroversion\Synchroversion($root, $path)

Create a new instance, ready for reading or writing. The first argument is the root directory where all files are stored and the second is the path within that root you'd like to use. We'll be tracking syslog in this example, so we'll just name it syslog.

setUmask($umask)

This can be used to set the permissions of files and directories created. The default umask is 0022, which means world-readable and user-writeable. You may choose to set this to 0000 if you want the permissions wide open, or 0007 if you want read/write for the user and group but deny permissions to others. Check out documentation for UNIX umask for more examples.

latest()

This returns the latest version of the content that has been stored.

exec(callable $cb)

To write a version of the content, pass a callable which returns the data to be stored. A version file will be created as well as a diff if there are previous versions.

retainState(int $count)

By default, the three latest full versions of the content are kept. This may be adjusted by setting this to less or more. Note that diffs are kept for the entire history, so it is always possible to reconstruct any past state. These are simply kept to review consistency.

State files are cleaned up on every call to exec(). If you'd like to clean up state files without calling exec, call purgeStateFiles() instead.

Example files

These two files illustrate a writer and a reader which track the syslog file.

A producer would likely be run regularly via cron or triggered by some other action. It could run anywhere from every minute to once a year - pick what makes sense for your data.

Run the update every 5 seconds:

In another terminal, fetch the latest version:

Todo


All versions of synchroversion with dependencies

PHP Build Version
Package Version
No informations.
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 andyvanee/synchroversion contains the following files

Loading the files please wait ....