承接 caeligo/scheduler-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

caeligo/scheduler-bundle

Composer 安装命令:

composer require caeligo/scheduler-bundle

包简介

File-based task scheduler bundle for Symfony with CLI and web dashboard

README 文档

README

A file-based task scheduler bundle for Symfony with a built-in web dashboard and full CLI management.

License: MIT

Why Caeligo?

  • No database required — Fully file-based storage. No Doctrine, no migrations, no extra infrastructure. Install and run in minutes.
  • Built-in web dashboard — A standalone, ready-to-use Twig UI ships with the bundle. Manage tasks, browse logs, and control your crontab — all from the browser, out of the box.
  • Native PHP attribute discovery — Use the modern #[AsSchedulableCommand] attribute on your commands. No YAML task definitions, no manual registration, no separate entity classes.
  • Crontab management from CLI and web — Install or uninstall your system crontab entry with a single command or a button click. No manual server configuration needed.
  • Shared hosting friendly — Works without long-running workers, message queues, or Redis. A simple cron job is all you need. An HTTP trigger fallback is also available.

Features

  • Cron expressions & simple intervals — Both scheduling modes supported
  • 10 CLI commands — Full terminal-based management: list, status, enable, disable, run, logs, purge, install, uninstall, and more
  • Overlap prevention — Skip task execution when a previous run is still in progress
  • Role-based access — Configurable role requirements for dashboard and crontab management
  • CSRF protection — All dashboard POST actions are CSRF-protected
  • Automatic log retention — Old execution logs are cleaned up automatically
  • EasyAdmin integration — Optional integration for projects already using EasyAdmin
  • Zero-config defaults — Sensible defaults let you get started with minimal configuration

Requirements

  • PHP 8.2+
  • Symfony 6.4 or 7.x
  • No database or additional services required

Installation

composer require caeligo/scheduler-bundle

Enable the Bundle

If you're not using Symfony Flex, add the bundle to config/bundles.php:

return [
    // ...
    Caeligo\SchedulerBundle\CaeligoSchedulerBundle::class => ['all' => true],
];

Configure Routes

Create config/routes/caeligo_scheduler.yaml:

caeligo_scheduler:
    resource: '@CaeligoSchedulerBundle/config/routes.yaml'
    prefix: /scheduler

Basic Configuration

Create config/packages/caeligo_scheduler.yaml:

caeligo_scheduler:
    route_prefix: '/scheduler'
    role_dashboard: 'ROLE_ADMIN'
    role_crontab: 'ROLE_SUPER_ADMIN'
    default_timeout: 300

For all configuration options, see Configuration Reference.

Quick Start

1. Make a Command Schedulable

Add the #[AsSchedulableCommand] attribute to any Symfony console command:

use Caeligo\SchedulerBundle\Attribute\AsSchedulableCommand;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;

#[AsCommand(name: 'app:cleanup:expired')]
#[AsSchedulableCommand(
    description: 'Remove expired records from the database',
    defaultExpression: '0 3 * * *',
    group: 'maintenance',
)]
class CleanupExpiredCommand extends Command
{
    // ...
}

2. Install the Crontab

php bin/console caeligo:scheduler:install

This adds a crontab entry that runs the scheduler every minute:

* * * * * cd '/path/to/project' && '/usr/bin/php' bin/console caeligo:scheduler:run >> /dev/null 2>&1 # caeligo-scheduler

3. Enable Tasks

php bin/console caeligo:scheduler:enable app:cleanup:expired

Or use the web dashboard at /scheduler.

4. Verify

php bin/console caeligo:scheduler:list
php bin/console caeligo:scheduler:status

CLI Commands

Command Description
caeligo:scheduler:run Run overdue scheduled tasks (crontab entry point)
caeligo:scheduler:list List all discovered schedulable commands
caeligo:scheduler:status Show overall scheduler health and status
caeligo:scheduler:run-now <command> Execute a specific task immediately
caeligo:scheduler:enable <command> Enable a scheduled task
caeligo:scheduler:disable <command> Disable a scheduled task
caeligo:scheduler:install Install the scheduler crontab entry
caeligo:scheduler:uninstall Remove the scheduler crontab entry
caeligo:scheduler:logs Show recent task execution logs
caeligo:scheduler:purge-logs [command] Purge execution logs (all or per task)

For detailed CLI usage, see CLI Reference.

Web Dashboard

A standalone web dashboard ships with the bundle — no separate admin package or frontend build step needed. Available at the configured route_prefix (default: /scheduler).

  • Tasks — View, enable/disable, edit, and run tasks directly from the browser
  • Logs — View execution history with full output details and status indicators. Clear logs per task or globally.
  • Settings — Install or remove the system crontab entry with a single click

For dashboard details, see Dashboard Guide.

Documentation

Document Description
Configuration Reference All configuration options in detail
CLI Reference Detailed usage of all 9 console commands
Dashboard Guide Web dashboard features and usage
Scheduling Guide Cron expressions, intervals, and task options
Architecture & Storage File-based storage, locking, and internals
Security Role-based access, CSRF, and security considerations
HTTP Trigger Shared hosting fallback via HTTP trigger
EasyAdmin Integration Optional EasyAdmin dashboard integration
Testing Running the test suite

Makefile Integration (Optional)

If your project uses a Makefile (common in Symfony projects), you can add convenient shortcut targets:

SYMFONY_CONSOLE = php bin/console

cron-list: ## List all schedulable commands
	@$(SYMFONY_CONSOLE) caeligo:scheduler:list

cron-status: ## Scheduler health status
	@$(SYMFONY_CONSOLE) caeligo:scheduler:status

cron-run: ## Run overdue tasks once
	$(SYMFONY_CONSOLE) caeligo:scheduler:run

cron-run-task: ## Run a specific task (usage: make cron-run-task CMD=app:my:command)
ifndef CMD
	@echo "ERROR: CMD is required. Usage: make cron-run-task CMD=app:some:command"
	@exit 1
endif
	$(SYMFONY_CONSOLE) caeligo:scheduler:run-now $(CMD)

cron-logs: ## Show scheduler execution logs
	@$(SYMFONY_CONSOLE) caeligo:scheduler:logs

cron-logs-purge: ## Purge all scheduler logs
	@$(SYMFONY_CONSOLE) caeligo:scheduler:purge-logs

cron-install: ## Install crontab entry
	$(SYMFONY_CONSOLE) caeligo:scheduler:install

cron-uninstall: ## Uninstall crontab entry
	$(SYMFONY_CONSOLE) caeligo:scheduler:uninstall

License

MIT — see LICENSE.

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

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

它主要适用于以下技术方向: 「symfony」 「bundle」 「cron」 「task」 「dashboard」 「scheduler」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-19