定制 ibexa/cron 二次开发

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

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

ibexa/cron

最新稳定版本:v5.0.4

Composer 安装命令:

composer require ibexa/cron

包简介

Simple cron bundle for Ibexa

README 文档

README

This package exposes cron/cron package for use in Ibexa (or just plain Symfony) via a simle command ibexa:cron:run.

This is not a replacement for cron/cron-bundle but rather a simpler alternative to it which can more easily grow into focusing more on Ibexa Platform needs in the future including e.g. support for handling cron jobs across a cluster install (separating jobs that should run on all nodes vs jobs that should only be run on one at a time and a lock system to go with it for instance).

Setup system cron

Pick your systems cron / scheduling and setup ibexa:cron:run command to run every minute and optionally specifying category (default: default):

Example for Linux crontab (crontab -e):

* * * * * /path/to/php bin/console ibexa:cron:run [ --category=default] >/dev/null 2>&1

Setting up own cron commands

Setting up own cron jobs is as simple as tagging services for your existing Symfony Commands.

The tag takes the following arguments:

  • name: ibexa.cron.job
  • schedule: Takes any kind of format supported by cron/cron, which mimics linux crontab format. E.g. * * * * *
  • category: (Optional, by default: default) Lets you separate cronjobs that should be run under different logic then default, e.g. infrequent jobs (NOTE: Means end user will need to setup several entries in his crontab to run all categories!)
  • options: (Optional, by default: '') Takes custom option/s in string format which are added to the command. (E.g. '--keep=0 --status=draft' for running the cleanup versions command)

Example

    date_based_published.cron.publish_scheduled:
        class: EzSystems\DateBasedPublisherBundle\Command\PublishScheduledCommand
        tags:
            - { name: console.command }
            - { name: ibexa.cron.job, schedule: '* * * * *' }

Logging run command

If you want to log outputs of commands processed by run command you have to add the monolog channel cronjob to your configuration.

Example

    monolog:
        channels: [...,'cronjob']
        handlers:
            cronjob:
                bubble: false
                level: info
                type: stream
                path: '%kernel.logs_dir%/cronjob.log'
                channels: [cronjob]

COPYRIGHT

Copyright (C) 1999-2025 Ibexa AS (formerly eZ Systems AS). All rights reserved.

LICENSE

This source code is available separately under the following licenses:

A - Ibexa Business Use License Agreement (Ibexa BUL), version 2.4 or later versions (as license terms may be updated from time to time) Ibexa BUL is granted by having a valid Ibexa DXP (formerly eZ Platform Enterprise) subscription, as described at: https://www.ibexa.co/product For the full Ibexa BUL license text, please see:

AND

B - GNU General Public License, version 2 Grants an copyleft open source license with ABSOLUTELY NO WARRANTY. For the full GPL license text, please see:

统计信息

  • 总下载量: 524.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 12
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: (GPL-2.0-only or proprietary) 8c3e8bab55faedddce7c5e78567460f9df1a8b41
  • 更新时间: 2021-11-09