Download the PHP package cronwatch/craft without Composer

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

CronWatch for Craft CMS

Monitoring for the work a Craft CMS site does in the background: its queue jobs and the console commands its crontab runs. Every run is recorded in the site's own database, and you are told when a run is missed, fails, gets stuck or runs much slower than usual, and again when it recovers. No server to run, no account to make.

This is the Craft CMS plugin of the CronWatch library (cronwatch/cronwatch), which also watches jobs in TypeScript, Ruby, Python, Go, Rust, Elixir, Java and .NET apps, plain PHP, Laravel, Symfony, WordPress and Drupal, and keeps the same tables in every language.

Requirements

Craft CMS 5.3 or newer, PHP 8.2 or newer, and Craft's own database (MySQL 8.0.13 or newer, MariaDB 10.6 or newer, or Postgres).

Install

Or from the Plugin Store in the Control Panel.

Installing makes three tables in Craft's database (cronwatch_jobs, cronwatch_runs and cronwatch_state, after Craft's table prefix); uninstalling drops them.

What is watched

Craft CMS has no scheduler of its own: scheduled work is console commands the server's crontab runs, and queue jobs. Both are watched when you say so, in config/cronwatch.php:

Inside a watched command or job, Cronwatch\Cronwatch::current()?->log('...') adds to the run's output and ->metric('name', 1.5) records a number.

The check

Missed and stuck runs are found by a check, php craft cronwatch/check, which prints cronwatch: checked 4 jobs, sent 0 alerts. Run it from the crontab every five minutes:

Settings

Settings, Plugins, CronWatch: where alerts go (email through Craft's mailer, a Slack incoming webhook, a webhook, signed when given a secret) and the grace a run is given (10 minutes by default). Each field takes an environment variable ($SLACK_WEBHOOK_URL), so a credential need not be in project config, and anything set in config/cronwatch.php wins over the form. Nothing leaves the site until a channel is set; with none, alerts go to Craft's log. A listener on Cronwatch\Craft\Plugin::EVENT_ALERTS adds channels (any of the library's, or a callable).

The dashboard

CronWatch in the Control Panel's navigation, for users with access to the plugin: the jobs' health, the last day as a timeline, each job's runs and output. Silencing, forgetting and "Run check now" need the "Silence, forget and check jobs" permission as well, and carry Craft's CSRF token.

The JSON API that @cronwatch/mcp talks to is off until a token is set ('apiToken' => '$CRONWATCH_TOKEN' in config/cronwatch.php, or the CRONWATCH_TOKEN environment variable); it is then at https://example.com/cronwatch/api, with the token as a bearer token.

License

MIT, as the library.


All versions of craft with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
craftcms/cms Version ^5.3
cronwatch/cronwatch Version ^0.12.0
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 cronwatch/craft contains the following files

Loading the files please wait ...