<commit_before>athene2-versioning
========================

[![Build Status](https://travis-ci.org/serlo-org/athene2-versioning.svg)](https://travis-ci.org/serlo-org/athene2-versioning)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/?branch=master)

# Installation

Install this module by adding

`"serlo-org/athene2-versioning": ">=2.0",`

to your composer.json.

# Using the versioning module

The versioning module enables you to manage repositories which contain revisions. Each repository has **n** revisions and one or zero HEAD revision. The HEAD revision is the current revision of that repository. The default implementation of the VersioningManager is **[Doctrine friendly](http://www.doctrine-project.org/)**!

# Features

* Doctrine implementation (using the ObjectManager)
* Bundled with [zfc-rbac](https://github.com/ZF-Commons/zfc-rbac) for authorization
* Events

## Understanding how it works

The versioning module consists of one `Versioning\Manager\VersioningManager`, who implements the `Versioning\Manager\VersioningManagerInterface`. The `Versioning\Entity\VersioningManager` manages models or entities which implement the `Versioning\Entity\RepositoryInterface` and the `Versioning\Entity\RevisionInterface`.

### Let's implement those entity interfaces!

#### RevisionInterface

```php
<?php

use Versioning\Entity\RepositoryInterface;
use Versioning\Entity\RevisionInterface;
use ZfcRbac\Identity\IdentityInterface;

/**
 * Class Revision
 *
 * @author <NAME>
 */
class Revision implements RevisionInterface
{
    /**
     * @var mixed
     */
    protected $id;
<commit_msg>Improved installation guide and link to data directory in the README<commit_after>athene2-versioning
========================

[![Build Status](https://travis-ci.org/serlo-org/athene2-versioning.svg)](https://travis-ci.org/serlo-org/athene2-versioning)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/serlo-org/athene2-versioning/?branch=master)

## Installation

athene2-versioning only officially supports installation through Composer. For Composer documentation, please refer to
[getcomposer.org](http://getcomposer.org/).

Install the module:

```sh
$ php composer.phar require serlo-org/athene2-versioning:~2.0
```

# Using the versioning module

The versioning module enables you to manage repositories which contain revisions. Each repository has **n** revisions and one or zero HEAD revision. The HEAD revision is the current revision of that repository. The default implementation of the VersioningManager is **[Doctrine friendly](http://www.doctrine-project.org/)**!

# Features

* Doctrine implementation (using the ObjectManager)
* Bundled with [zfc-rbac](https://github.com/ZF-Commons/zfc-rbac) for authorization
* Events

## Understanding how it works

The versioning module consists of one `Versioning\Manager\VersioningManager`, who implements the `Versioning\Manager\VersioningManagerInterface`. The `Versioning\Entity\VersioningManager` manages models or entities which implement the `Versioning\Entity\RepositoryInterface` and the `Versioning\Entity\RevisionInterface`.

### Let's implement those entity interfaces!

You can find example implementations [here](data)!

#### RevisionInterface

```php
<?php

use Versioning\Entity\RepositoryInterface;
use Versioning\Entity\RevisionInterface;
use ZfcRbac\Identity\IdentityInterface;

/**
 * Class Revision
 *
 * @author <NAME>
 */
class Revision implements RevisionInterface
{
    /**
     * @var mixed
     */
    protected $id;

{'fraction_non_alphanumeric': 0.13149548670407415, 'fraction_numerical': 0.005123200780678214, 'mean_word_length': 5.518282988871224, 'pattern_counts': {'":': 1, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5945195', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1203, 'n_words': 288}