定制 cron/cron-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cron/cron-bundle

Composer 安装命令:

composer require cron/cron-bundle

包简介

Symfony cron

README 文档

README

Packagist Build status Packagist License

Cron integration for symfony.

Installation

Installing this bundle can be done through these simple steps:

  1. Add the bundle to your project as a composer dependency:
composer require cron/cron-bundle
  1. Add the bundle to your application kernel:
// app/AppKernel.php
public function registerBundles()
{
    // ...
    $bundle = array(
        // ...
        new Cron\CronBundle\CronCronBundle(),
    );
    // ...

    return $bundle;
}
  1. Update your DB schema
bin/console make:migration
bin/console doctrine:migrations:migrate
  1. Start using the bundle:
bin/console cron:list
bin/console cron:run
  1. To run your cron jobs automatically, add the following line to your (or whomever's) crontab:
* * * * * /path/to/symfony/install/app/console cron:run 1>> /dev/null 2>&1

OR If you don't have a dedicated cron daemon (e.g. in Heroku), you can use:

bin/console cron:start # will run in background mode, use --blocking to run in foreground
bin/console cron:stop # will stop the background cron daemon

Available commands

list

bin/console cron:list

Show a list of all jobs. Job names are show with [x] if they are enabled and [ ] otherwise.

create

bin/console cron:create

Create a new job.

delete

bin/console cron:delete _jobName_

Delete a job. For your own protection, the job must be disabled first.

enable

bin/console cron:enable _jobName_

Enable a job.

disable

bin/console cron:disable _jobName_

Disable a job.

run

bin/console cron:run [--force] [job]

which we borrowed from Symfony. Make sure to check out php-cs-fixer as this will help you a lot. Please note that --force forces the job to be executed (even if disabled) based on the job schedule

run now, independent of the job schedule

bin/console cron:run --schedule_now [--force] job

run in non-cli contexts (i.e. from a controller)

bin/console cron:run --script-name='bin/console'

start

bin/console cron:start [--blocking]

Start the cron as a daemon. By default it forks itself to the background and suppresses any output. The --blocking option will keep it in the foreground and will display output. This is useful when you don't have a dedicated cron daemon (e.g. on Heroku).

stop

bin/console cron:stop

Stops the background cron daemon started with cron:start. This is not applicable when the daemon was started with --blocking.

If you would like to help, take a look at the list of issues.

Requirements

PHP 5.5.9 or above

Author and contributors

Dries De Peuter - dries@nousefreak.be - http://nousefreak.be

See also the list of contributors who participated in this project.

License

CronBundle is licensed under the MIT license.

cron/cron-bundle 适用场景与选型建议

cron/cron-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.54M 次下载、GitHub Stars 达 186, 最近一次更新时间为 2014 年 03 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 cron/cron-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 cron/cron-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 cron/cron-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.54M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 191
  • 点击次数: 21
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 186
  • Watchers: 8
  • Forks: 76
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-07