se7enxweb/ezplatform-cron 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

se7enxweb/ezplatform-cron

最新稳定版本:v4.0.0-alpha2

Composer 安装命令:

composer require se7enxweb/ezplatform-cron

包简介

Simple cron bundle for eZ Platform

README 文档

README

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

This is not a replacement for cron/cron-bundle but rather a simpler alternative to it which can more esaily grow into focusing more on eZ 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 ezplatform:cron:run command to run every minute and optionally specifying category (default: default):

Example for Linux crontab (crontab -e):

* * * * * /path/to/php app/console ezplatform: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: ezplatform.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: ezplatform.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]

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2025-08-24