Download the PHP package flexic/scheduler without Composer

On this page you can find all versions of the php package flexic/scheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package scheduler

🕧 PHP Scheduler

PHP Schedule is a simple library for scheduling tasks in PHP.
It is inspired by the Laravel Scheduler and Symfony Messenger.


Installation

Run

to install flexic/scheduler.


Setup Events to schedule

Schedule events are classes that implement the ScheduleEventInterface. Inside the configure method, you can use the Schedule object to define when the event should be scheduled to run.

Setup Schedule Worker (Console Command)

Run

to start the schedule worker. Worker will automatically load all events from the given config files and run them.

Options

Option Description Format Default
limit Limits the worker to the give number. Worker stops automatically if number if max Event runs exceeded. int -
timeLimit Worker stops automatically after given time. int (seconds) -
intervalLimit Worker stops automatically after give amount of intervals. int -
memoryLimit Worker stops automatically if usage of memory exceeds the given limit. int (bytes) -
parallel Worker runs events in parallel if set to true. boolean false
parallelLimit Let worker run only defined amount of parallel runs at same time. int -

Setup Schedule Worker (own script)

ScheduleEvent Factory

The ScheduleEventInterface is implemented to allow the usage of a factory to create the event. This is useful if you want to use a dependency injection container to create the event.

Schedule API

Method Description
cron($expression) Schedule the event on a Cron expression.
timezone($timezone) Set the timezone the expression should run in.
minute($minute) Set minutes to cron expression
hour($hour) Set hours to cron expression
day($day) Set days to cron expression
month($month) Set months to cron expression
dayOfWeek($day) Set days of week to cron expression
builder() Return an instance of flexic/cron-builder.

cron() method accepts string, or objects of type CronBuilder & Cron of flexic/cron-builder.

Methods for tokens allows usage of Expressions from flexic/cron-builder.

Worker API

Method Description
start() Starts the worker.
stop() Stops the worker.
restart() Reinitialize and restarts the worker.
update($configuration, $scheduleEvents) Update the worker and starts with new configuration.

Worker Lifecycle Events

Event Name Description
Worker Lifecycle Flexic\Scheduler\Event\Event\Lifecycle\\
WorkerInitializedEvent Executed when worker is initialized.
WorkerStartEvent Executed when worker is started.
WorkerStopEvent Executed when worker is stopped.
WorkerRestartEvent Executed when worker is restarted.
WorkerUpdateEvent Executed everytime the worker is updated.
Run Lifecycle Flexic\Scheduler\Event\Event\Run\\
WorkerRunStartEvent Executed everytime an event is started to process.
WorkerRunEnvEvent Executed everytime an event is finished to process.
Interval Lifecycle Flexic\Scheduler\Event\Event\Interval\\
WorkerIntervalStartEvent Executed everytime a interval is started.
WorkerIntervalEndEvent Executed everytime a interval is finished.
Execution Lifecycle Flexic\Scheduler\Event\Event\Execute\\
WorkerExecuteEvent Executed everytime an event is executed.
WorkerExecuteSequentialEvent Executed everytime an event is executed sequentially.
WorkerExecuteParallelStartEvent Executed everytime an event is executed parallel.
WorkerExecuteParallelResumeEvent Executed everytime an parallel executed event is resumed.

License

This package is licensed using the GNU License.

Please have a look at LICENSE.md.


Donate


All versions of scheduler with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
dragonmantank/cron-expression Version ^3.3.2
flexic/cron-builder Version ^1.0.0
psr/log Version ^3.0.0
symfony/console Version ^6.1.0
symfony/event-dispatcher Version ^6.1.0
symfony/options-resolver Version ^6.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package flexic/scheduler contains the following files

Loading the files please wait ....