<commit_before>README
======

What is symfony-cron?
---------------------

*symfony-cron* is a bundle of utilities for [Symfony2][1] that provide
functions related to scheduled tasks run out of a cron context.

Requirements
------------

*symfony-cron* is supported on [PHP 5.4+][2] with [Symfony 2.5+][1].

Installation
------------

The best way to install *symfony-cron* is to include the bundle using a
mechanism such as [composer][3].  Information about the package is
published to [packagist][4].

Use
---

To use *symfony-cron* in a Symfony2-based project, start by defining how
you want to use the system.  The following checklist might help:

* What type of lock service will be used?  (File, memcached, etc.)
* Do commands need to be executed in a child process?
  - Processes that unexpectedly terminate cause locks to be unreleased
    if not executed in a child process, thus preventing future processes
    from running.

### Example: File Lock with Child Process ###

app/config/config.yml:
```yml
services:
    symfony_cron.lock_file_service:
        class: SymfonyCron\Component\Lock\LockFileService
    symfony_cron.default_lock_service: "@symfony_cron.lock_file_service"
    symfony_cron.process_service:
        class: SymfonyCron\Component\Process\ProcessService
```

crontab:
```
* * * * * /path/to/script
```

/path/to/script:
```bash
#!/bin/bash

/usr/bin/php \
    /path/to/symfony/app/console \
    cron:single_exec \
        --id /path/to/lock/files/some-unique-file \
        --child_process \
    -- \
        /path/to/child/script \
        --script-option \
        script-args
```

### Example: Multiple Instances of Same Script as Embedded Application ###

app/config/config.yml:
```yml
services:
    symfony_cron.lock_file_service:
        class: SymfonyCron\Component\Lock\LockFileService
    symfony_cron.default_lock_service: "@symfony_cron.lock_file_service"
    symfony_cron.process_service:
        class: SymfonyCron\Component\Process\ProcessService
```

crontab:
```
* * * * * /path/to/script instance-1-unique-key parameter-set-1
* * * * * /path/to/script instance-2-unique-key parameter-set-2
```

/path/to/script:
```bash
#!/bin/bash

KEY="$1"
PARAM="$2"

/usr/bin/php \
    /path/to/symfony/app/console \
    cron:single_exec \
        --id ${KEY} \
    -- \
        some:command \
        ${PARAM}
```

Contributing
------------<commit_msg>Fixed namespace reference in README.md<commit_after>README
======

What is symfony-cron?
---------------------

*symfony-cron* is a bundle of utilities for [Symfony2][1] that provide
functions related to scheduled tasks run out of a cron context.

Requirements
------------

*symfony-cron* is supported on [PHP 5.4+][2] with [Symfony 2.5+][1].

Installation
------------

The best way to install *symfony-cron* is to include the bundle using a
mechanism such as [composer][3].  Information about the package is
published to [packagist][4].

Use
---

To use *symfony-cron* in a Symfony2-based project, start by defining how
you want to use the system.  The following checklist might help:

* What type of lock service will be used?  (File, memcached, etc.)
* Do commands need to be executed in a child process?
  - Processes that unexpectedly terminate cause locks to be unreleased
    if not executed in a child process, thus preventing future processes
    from running.

### Example: File Lock with Child Process ###

app/config/config.yml:
```yml
services:
    symfony_cron.lock_file_service:
        class: SymfonyCronBundle\Component\Lock\LockFileService
    symfony_cron.default_lock_service: "@symfony_cron.lock_file_service"
    symfony_cron.process_service:
        class: SymfonyCronBundle\Component\Process\ProcessService
```

crontab:
```
* * * * * /path/to/script
```

/path/to/script:
```bash
#!/bin/bash

/usr/bin/php \
    /path/to/symfony/app/console \
    cron:single_exec \
        --id /path/to/lock/files/some-unique-file \
        --child_process \
    -- \
        /path/to/child/script \
        --script-option \
        script-args
```

### Example: Multiple Instances of Same Script as Embedded Application ###

app/config/config.yml:
```yml
services:
    symfony_cron.lock_file_service:
        class: SymfonyCronBundle\Component\Lock\LockFileService
    symfony_cron.default_lock_service: "@symfony_cron.lock_file_service"
    symfony_cron.process_service:
        class: SymfonyCronBundle\Component\Process\ProcessService
```

crontab:
```
* * * * * /path/to/script instance-1-unique-key parameter-set-1
* * * * * /path/to/script instance-2-unique-key parameter-set-2
```

/path/to/script:
```bash
#!/bin/bash

KEY="$1"
PARAM="$2"

/usr/bin/php \
    /path/to/symfony/app/console \
    cron:single_exec \
        --id ${KEY} \
    -- \
        some:command \
        ${PARAM}
```

Contributing
------------
{'fraction_non_alphanumeric': 0.14410118183703088, 'fraction_numerical': 0.00704955421936554, 'mean_word_length': 2.9155844155844157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1577230', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1565, 'n_words': 400}