<commit_before>BOMOIcalBundle
==============

This bundle is used to create an ics file or url to populate a shared calendar with events.

## Overview

```php
<?php
public function getIcs()
{
    $provider = $this->get('bomo_ical.ics_provider');

    $tz = $provider->createTimezone();
    $tz
        ->setTzid('Europe/Paris')
        ->setProperty('X-LIC-LOCATION', $tz->getTzid())
        ;

    $cal = $provider->createCalendar($tz);

    $cal
        ->setName('My cal1')
        ->setDescription('Foo')
        ;

    $datetime = new \Datetime('now');
    $event = $cal->newEvent();
    $event
        ->setStartDate($datetime)
        ->setEndDate($datetime->modify('+5 hours'))
        ->setName('Event 1')
        ->setDescription('Desc for event')
        ->setAttendee('<EMAIL>')
        ->setAttendee('<NAME>')
        ;

    $alarm = $event->newAlarm();
    $alarm
        ->setAction('DISPLAY')
        ->setDescription($event->getProperty('description'))
        ->setTrigger('-PT2H') //See Dateinterval string format
        ;

    // All Day event
    $event = $cal->newEvent();
    $event
        ->isAllDayEvent()
        ->setStartDate($datetime)
        ->setEndDate($datetime->modify('+10 days'))
        ->setName('All day event')
        ->setDescription('All day visualisation')
        ;

    $calStr = $cal->returnCalendar();

    return new Response(
        $calStr,
        200,
        array(
            'Content-Type' => 'text/calendar; charset=utf-8',
            'Content-Disposition' => 'attachment; filename="calendar.ics"',
        )
    );
}
```

## Versions

 - 2013/10/01 : first version
 - 2013/10/02 : Fix issue #2
 - 2013/10/07 : Fix issue #1
 - 2017/01/05 : Merge pull request #15; Now Kigkonsult is required by composer
 - 2017/04/07 : Merge pull request #18
 - 2017/06/07 : Merge pull request #20
 - 2017/06/08 : Merge pull request #19

## Actual state

This bundle is in **stable** state;

## Installation

Add BOMOIcalBundle in your composer.json

```js
{
    "require": {
        "bomo/ical-bundle": "1.0.*"
    }
}
```

**Note:**
> Kigkonsult is require on version `dev-master`. You need to change your `minimum-stability` or require explicitly `kigkonsult/icalcreator` to prevent composer dependencies errors.

```js
{
    "require": {
        "bomo/ical-bundle": "1.0.*"
    },
    "minimum-stability": "dev"
}
```

or

```js
{
    "require": {
        "bomo/ical-bundle": "1.0.*",
        "kigkonsult/icalcreator": "dev-master"
    }
}
```

Now tell composer to download the bundle by running the step:

``` bash
$ php composer.phar update bomo/ical-bundle
```

AppKernel.php

``` php
$bundles = array(
    ...
    new BOMO\IcalBundle\BOMOIcalBundle(),
);
```


## User's Guide
All objects can be managed regardless by the provider. But the object need to be attached.
>Event attached to Calendar<commit_msg>Remove note on non-stable kigkonsult<commit_after>BOMOIcalBundle
==============

This bundle is used to create an ics file or url to populate a shared calendar with events.

## Overview

```php
<?php
public function getIcs()
{
    $provider = $this->get('bomo_ical.ics_provider');

    $tz = $provider->createTimezone();
    $tz
        ->setTzid('Europe/Paris')
        ->setProperty('X-LIC-LOCATION', $tz->getTzid())
        ;

    $cal = $provider->createCalendar($tz);

    $cal
        ->setName('My cal1')
        ->setDescription('Foo')
        ;

    $datetime = new \Datetime('now');
    $event = $cal->newEvent();
    $event
        ->setStartDate($datetime)
        ->setEndDate($datetime->modify('+5 hours'))
        ->setName('Event 1')
        ->setDescription('Desc for event')
        ->setAttendee('<EMAIL>')
        ->setAttendee('<NAME>')
        ;

    $alarm = $event->newAlarm();
    $alarm
        ->setAction('DISPLAY')
        ->setDescription($event->getProperty('description'))
        ->setTrigger('-PT2H') //See Dateinterval string format
        ;

    // All Day event
    $event = $cal->newEvent();
    $event
        ->isAllDayEvent()
        ->setStartDate($datetime)
        ->setEndDate($datetime->modify('+10 days'))
        ->setName('All day event')
        ->setDescription('All day visualisation')
        ;

    $calStr = $cal->returnCalendar();

    return new Response(
        $calStr,
        200,
        array(
            'Content-Type' => 'text/calendar; charset=utf-8',
            'Content-Disposition' => 'attachment; filename="calendar.ics"',
        )
    );
}
```

## Versions

 - 2013/10/01 : first version
 - 2013/10/02 : Fix issue #2
 - 2013/10/07 : Fix issue #1
 - 2017/01/05 : Merge pull request #15; Now Kigkonsult is required by composer
 - 2017/04/07 : Merge pull request #18
 - 2017/06/07 : Merge pull request #20
 - 2017/06/08 : Merge pull request #19

## Actual state

This bundle is in **stable** state;

## Installation

Add BOMOIcalBundle in your composer.json

```js
{
    "require": {
        "bomo/ical-bundle": "1.0.*"
    }
}
```

Now tell composer to download the bundle by running the step:

``` bash
$ php composer.phar update bomo/ical-bundle
```

AppKernel.php

``` php
$bundles = array(
    ...
    new BOMO\IcalBundle\BOMOIcalBundle(),
);
```


## User's Guide
All objects can be managed regardless by the provider. But the object need to be attached.
>Event attached to Calendar
{'fraction_non_alphanumeric': 0.16099943640804057, 'fraction_numerical': 0.030058237835806877, 'mean_word_length': 2.5635876840696117, 'pattern_counts': {'":': 10, '<': 9, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '274933', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1698, 'n_words': 428}