helthe/chronos-bundle

为您的 Symfony2 项目提供面向对象的 cron 作业管理

安装: 12

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

dev-master / 1.0.x-dev 2014-09-16 06:46 UTC

This package is auto-updated.

Last update: 2024-08-29 03:35:21 UTC


README

Helthe Chronos Bundle 提供了一个面向对象的库,用于在 Symfony2 中管理 crontab 和程序化 cron 作业。

Build Status

安装

步骤 1: Composer

在您的 composer.json 中添加以下内容

{
    "require": {
        "helthe/chronos-bundle": "~1.0"
    }
}

步骤 2: 注册包

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Helthe\Bundle\ChronosBundle(),
    );
}
```

### Step 3: Configure the bundle

The bundle comes with a sensible default configuration, which is listed below.

````yml
helthe_chronos
    cache_dir: %kernel.cache_dir%/helthe_chronos
    crontab:
        default_user: ~ # If null, edits the crontab of the user running the command.
        executable: /usr/bin/crontab # Path to crontab executable.
        run_job: false # If true, will add the helthe:chronos:run command to crontab to be run every minute.
    enable_annotations: false # If true, allows for the use of annotations.
```

## Resources

You can run the unit tests with the following command:

````bash
$ cd path/to/Helthe/Bundle/XXX/
$ composer.phar install --dev
$ phpunit
```