Download the PHP package jenner/crontab without Composer
On this page you can find all versions of the php package jenner/crontab. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jenner/crontab
More information about jenner/crontab
Files in jenner/crontab
Informations about the package crontab
php_crontab
php crontab base on pcntl and react/event-loop
Why use php_crontab?
When we have a handful of crontab tasks, crontab service is enough for us to manage them. If we have many crontab tasks, there will be some problems like:
- The crontab tasks are managed in a text file. If there are no comment, it will be hard for fresh man to understand what they are.
- If the crontab tasks are distributed in different servers, it will be hard to manage them.
- If you want to collect the crontab tasks' logs, it will be not easy.
- Tasks of different users must written in different files. Based on the above reasons, we need a crontab manager which can manage crontab tasks together and configure the tasks.
How to use php_crontab?
First composer require jenner/crontab
.
There are two ways to use php_crontab to manage your crontab tasks.
You can just write a php script and add it to the crontab config file
with the command crontab -e
. The php script should run every minute. For example tests/simple.php
Or you can write a php daemon script which will run as a service and will not exit until someone kill it.
It will check the tasks every minute. For example tests/daemon.php
Import
Properties
- The crontab tasks can be stored in any way you what. For example, mysql, reids. What's more? You can develop a web application to manage them.
- The tasks of different users can be managed together.
- Multi-Process, every task is a process.
- You can set the user and group of a crontab task
- STDOUT can be redirected
- Based on react/event-loop, it can run as a daemon.
- A HTTP server which you can manage the crontab tasks through it.
- Dynamic task loader, you can register a task loader by Daemon::registerTaskLoader, which will execute every 60 seconds and update the crontab tasks.
HTTP interfaces
HTTP METHOD: GET
add
add new task to crontab serverget_by_name
get task by nameremove_by_name
remove task by nameclear
clear all taskget
get all tasksstart
start crontab loopstop
stop crontab loop
Examples:
TODO
- add log handler interface.
- add http log handler, socket log handler, file handler and so on.
- separate stdout and stderr. use different handlers
run based on crontab service
run as a daemon
it will check the task configs every minute.
Or use the task loader
run as a daemon and start the http server
Then you can manage the crontab task by curl like:
run the script
All versions of crontab with dependencies
ext-posix Version *
jenner/simple_fork Version 0.5
monolog/monolog Version 1.17.1
react/http Version v0.4.1
symfony/process Version v2.7.5