Download the PHP package eric28/dispatcher without Composer

On this page you can find all versions of the php package eric28/dispatcher. 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 dispatcher

Dispatcher

Dispatcher allows you to schedule your artisan commands within your Laravel project, eliminating the need to touch the crontab when deploying. It also allows commands to run per environment and keeps your scheduling logic where it should be, in your version control.


Latest Stable Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

README Contents

Features

  • Schedule artisan commands to run automatically
  • Scheduling is maintained within your version control system
  • Single source of truth for when and where commands run
  • Schedule commands to run with arguments and options
  • Run commands as other users
  • Run commands in certain environments
  • Use custom drivers for custom scheduling contexts

Tutorial

By Ben Kuhl at the Laravel Louisville meetup (@lurvul): Video - Slides

By Jefferey Way at Laracasts: Recurring Tasks the Laravel Way

Installation

NOTICE: Laravel 5 now includes scheduling out of the box. This package will no longer be maintained for Laravel 5 and above

Requirements 1.4.* 2.*
Laravel 4.1/4.2 5.x
PHP 5.3+ 5.4+
HHVM 3.3+ 3.3+
Install with Composer... ~1.4 ~2.0@dev

If you're using Laravel 4 view the readme in the 1.4 branch

Add this line to the providers array in your config/app.php file :

Add the following to your root Crontab (via sudo crontab -e):

If you are adding this to /etc/cron.d you'll need to specify a user immediately after * * * * *.

You may add this to any user's Crontab, but only the root crontab can run commands as other users.

Upgrading from 1.4 to 2.0

In all scheduled commands...

Usage

If commands are not visible via php artisan then they cannot be scheduled.

Generating New Scheduled Commands

Use php artisan scheduled:make to generate a new scheduled command, the same way you would use artisan's command:make. Then register your command with Laravel.

Scheduling Existing Commands

You may either implement \Indatus\Dispatcher\Scheduling\ScheduledCommandInterface or follow the below steps.

  1. Add use statements to your command. If you're using a custom driver you will use a different Scheduler class.

  2. Extend \Indatus\Dispatcher\Scheduling\ScheduledCommand
  3. Implement schedule():

For details and examples on how to schedule, see the DateTime Driver.

Running Commands As Users

You may override user() to run a given artisan command as a specific user. Ensure your scheduled:run artisan command is running as root.

This feature may not be supported by all drivers.

Environment-Specific Commands

You may override environment() to ensure your command is only scheduled in specific environments. It should provide a single environment or an array of environments.

Maintenance Mode

By default, cron commands will not run when application is in Maintenance Mode. This will prevent all sorts of weird output that might occur if a cron command is run while you are migrating a database or doing a composer update.

You may override runInMaintenanceMode() to force your command to still be run while the application is in maintenance mode.

Advanced scheduling

You may schedule a given command to to run at multiple times by schedule() returning multiple Schedulable instances.

You may also schedule a command to run with arguments and options.

NOTE: Both args() and opts(), whichever is called first, will internally create a new Schedulable instance for you so you don't need to App::make().

Drivers

Drivers provide the ability to add additional context to your scheduling. Building custom drivers is a great way to customize this context to your application's needs.

DateTime (Default)

Examples of how to schedule:

Custom Drivers

Custom drivers allow you to provide application context within scheduling. For example, an education-based application may contain scheduling methods like inServiceDays(), springBreak() and christmasBreak() where commands are run or don't run during those times.

Create a packagepath such as \MyApp\ScheduleDriver\ and create two classes:

  • Scheduler that implements Indatus\Dispatcher\Scheduling\Schedulable. This class should provide a useful interface for programmers to schedule their commands.
  • ScheduleService that extends \Indatus\Dispatcher\Services\ScheduleService. This class contains logic on how to determine if a command is due to run.

Publish the configs using php artisan config:publish indatus/dispatcher. Then update your driver configuration to reference the package in which these 2 classes are included (do not include a trailing slash):

FAQ

I need to deploy to multiple servers representing a single environment. How can I be sure my command is only run by a single server and not run on each server?

Schedule scheduled:run to run every minute with rcron:

Why are my commands not running when I've scheduled them correctly? I'm also not seeing any error output

1) Verify that mcrypt is installed and working correctly via the command php -i | mcrypt.

2) Utilizing php artisan scheduled:run --debug will tell you why they're not running. If you do not see your command listed here then it is not set up correctly.

Example:

I have commands that extend ScheduledCommand but why don't they appear in when I run scheduled:summary?

Commands that are disabled will not appear here. Check and be sure isEnabled() returns true on those commands.


All versions of dispatcher with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
wp-cli/php-cli-tools Version v0.9.4-patch46
mtdowling/cron-expression Version ~1.0.3
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 eric28/dispatcher contains the following files

Loading the files please wait ....