Download the PHP package xshimmy/kohana-cron without Composer

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

Kohana-Cron

This module provides a way to schedule tasks (jobs) within your Kohana application.

Installation

Step 1: Download the module into your modules subdirectory.

Step 2: Enable the module in your bootstrap file:

/**
 * Enable modules. Modules are referenced by a relative or absolute path.
 */
Kohana::modules(array(
    'cron'       => MODPATH.'cron',
    // 'auth'       => MODPATH.'auth',       // Basic authentication
    // 'codebench'  => MODPATH.'codebench',  // Benchmarking tool
    // 'database'   => MODPATH.'database',   // Database access
    // 'image'      => MODPATH.'image',      // Image manipulation
    // 'orm'        => MODPATH.'orm',        // Object Relationship Mapping
    // 'pagination' => MODPATH.'pagination', // Paging of results
    // 'userguide'  => MODPATH.'userguide',  // User guide and API documentation
));

Step 3: Make sure the settings in config/cron.php are correct for your environment. If not, copy the file to application/config/cron.php and change the values accordingly.

Usage

In its simplest form, a task is a PHP callback and times at which it should run. To configure a task call Cron::set($name, array($frequency, $callback)) where $frequency is a string of date and time fields identical to those found in crontab. For example,

Cron::set('reindex_catalog', array('@daily', 'Catalog::regenerate_index'));
Cron::set('calendar_notifications', array('*/5 * * * *', 'Calendar::send_emails'));

Configured tasks are run with their appropriate frequency by calling Cron::run(). Call this method in your bootstrap file, and you're done!

Advanced Usage

A task can also be an instance of Cron that extends next() and/or execute() as needed. Such a task is configured by calling Cron::set($name, $instance).

If you have access to the system crontab, you can run Cron less (or more) than once every request. You will need to modify the lines where the request is handled in your bootstrap file to prevent extraneous output. The default is:

/**
 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
 * If no source is specified, the URI will be automatically detected.
 */
echo Request::instance()
    ->execute()
    ->send_headers()
    ->response;

Change it to:

if ( ! defined('SUPPRESS_REQUEST'))
{
    /**
     * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
     * If no source is specified, the URI will be automatically detected.
     */
    echo Request::instance()
        ->execute()
        ->send_headers()
        ->response;
}

Then set up a system cron job to run your application's Cron once a minute:

* * * * * /usr/bin/php -f /path/to/kohana/modules/cron/run.php

The included run.php should work for most cases, but you are free to call Cron::run() in any way you see fit.


All versions of kohana-cron with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
composer/installers Version *
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 xshimmy/kohana-cron contains the following files

Loading the files please wait ....