Download the PHP package michaels/mistletoe without Composer
On this page you can find all versions of the php package michaels/mistletoe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michaels/mistletoe
More information about michaels/mistletoe
Files in michaels/mistletoe
Package mistletoe
Short Description Cron and Single Use Task Management for PHP.
License MIT
Homepage https://github.com/michaels/mistletoe
Informations about the package mistletoe
- todo: Parse Annotated Classes
- Separate processes (configurable)
- Tests
- documentation, repository
Mistletoe (PHP Cron Tasks)
Because Task Management Should Feel Like Christmas...or at least not suck!
Mistletoe provides a super easy-to-use way to manage cron tasks for php.
Simply use the human-readable, fluent builder to add tasks, point ONE cron task to the mt
file, and watch the magic happen.
Basic Usage
In mistletoe.php
In your crontasks, simply add /path/to/bin/mt run:due
to execute how ever often you want.
Includes Full Support For
- Simplify ALL cronjobs into a single job
- Environment detection and limiting (only run certain tasks in production)
- Tasks may be console commands, classes, or callables
- Fluent cron schedule builder
- An included TaskRunner
- Easy to create custom task runners
- CLI application
- Fully extensible
- PSR and PHP The Right Way Compliant
Install
You can use mistletoe in one of three ways:
As a Phar (Best)
You may download a ready-to-use version of Box as a Phar:
- Go to https://github.com/chrismichaels84/mistletoe/releases/latest
- Download the
mt
under Downloads - Put it somewhere you'll remember it and/or add it to your path!
As a Global Composer Install (Better)
This is probably the best way when you have other tools like phpunit and other tools installed in this way:
You may need to add composer's bin directory to your path.
As a Composer Dependency (Advanced)
You may also install Mistletoe as a dependency for your Composer managed project:
(or)
Be aware that using this approach requires additional configuration steps to prevent Mistletoe's own dependencies from colliding with your project's dependencies.
Usage
As a Command Line Tool
The easiest way to get setup is to create a mistletoe.php
file to hold your cron tasks.
This file simply returns an instance of Mistletoe\TaskPlanner
all configured and ready to go.
From there, you just use the cli commands. Mistletoe assumes the default mistletoe.php
is
in the current working directory. You may specify a relative or absolute path to any file
that returns a TaskPlanner instance.
For example:
mt list:all
- assumesmistletoe.php
is in this dirmt list:all /full/path/to/file.php
- will use the full pathmt list:all ../to/file.php
- will use the relative path
Commands
list:all
- Lists ALL the commands that are register with info about eachlist:due
- Lists only the command that are due at that moment with info about eachrun:due
- Runs whatever commands are due at that momentrun:all
- Will force run EVERY command registeredrun:task Full/Class/Path
- Will run only that one task, due or nothelp
- Shows this guide
Options
If you set the verbosity level to "verbose" or higher, it will print extra information.
See http://symfony.com/doc/current/components/console/introduction.html#verbosity-levels for more information.
Setting up the TaskPlanner
The config file only need return an instance of TaskPlanner that has been configured.
There are several methods that make setting it up easy.
For more options, see Mistletoe\TaskPlanner
.
Note: All that's required is at least on add()
method
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Credits
- Michael Wilson
- Special Thanks to FBS
License
The MIT License (MIT). Please see License File for more information.