Download the PHP package glpzzz/yii2-cron without Composer

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

glpzzz/yii2-cron

Attribute-driven cron discovery and crontab synchronisation for Yii2 console applications.

Tag console actions with #[Cron], then let the module install/remove/list the matching lines in the invoking user's crontab. A read-only web page shows what is declared and flags any drift from what is actually installed.

Install

Wire it up

Mount the module (conventionally as cron) and point scan at the namespace/path that holds your #[Cron] controllers. Put the shared parts in common/config/main.php:

and the console-only controller namespace in console/config/main.php:

The module registers manage (a yii\console\Controller) in console apps and status (a yii\web\Controller) in web apps -- each only where it can run.

Tag actions

schedule: null marks an action as cron-manageable and documents it, but installs nothing.

Console commands

<route> is given without the module prefix, e.g. users/notify-for-insurance. Run install-all --force --interactive=0 on deploy, after migrations.

Web status page

<module-mount>/status (e.g. /admin/cron/status) lists the discovered crons and, when the web user can read its own crontab, flags missing / drifted / orphaned lines. It is read-only -- the one place a web request runs crontab -l, and it never writes.

Access control is the host application's responsibility. The module knows nothing about your roles; protect the route with your app's access filter.

Testing

glpzzz\cron\testing\FakeCrontab and FakeCronScanner let you drive the controllers without touching the real crontab. Bind them as the module's components in your test config:

Requirements

PHP >= 8.1, Yii 2.0.14+, a POSIX crontab binary on the host that runs the sync command.


All versions of yii2-cron with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
yiisoft/yii2 Version ~2.0.14
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 glpzzz/yii2-cron contains the following files

Loading the files please wait ...