Download the PHP package mybuilder/cronos-bundle without Composer

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

Cronos Bundle

A bundle for Symfony 4/5/6 that allows you to use @Cron annotations to configure when cron should run your console commands.

Uses the Cronos library to do the actual output and updating.

Installation

Install with composer

Run the composer require command:

Enable the bundle

If you do not use Symfony Flex, enable the bundle in the config/bundles.php for Symfony 4/5/6:

Configure the bundle

You can add the following to your config/packages/my_builder_cronos.yaml (Symfony 4/5/6) to configure the package.

option description
key Unique key that wraps all the cron configured for the current application.
mailto Sets the default email address for all cron output to go to.
path Sets the path for all commands in the crontab it works just like the shell PATH, but it does not inherit from your environment. That means you cannot use ~ or other shell expansions.
executor Allows you to specify a program that all commands should be passed to such as /usr/local/bin/php.
console Allows you to specify the console that all commands should be passed to such as bin/console.
shell Allows you to specify which shell each program should be run with.

Usage

The first step is to add the use case for the annotation to the top of the command you want to use the @Cron annotations in.

Then add to the phpdoc for the command class the '@Cron' annotation which tells cron when you want it to run. This example says it should be run on the web server, every 5 minutes, and we don't want to log any output.

Specifying when to run

The whole point of cron is being able to specify when a script is run therefore there are a lot of options.

You should read the general cron info for a general idea of cron and what you can use in these time fields.

Please note You CANNOT use */ in the annotations, if you want */5 just put /5 and Cronos will automatically change it to */5.

Annotation examples

annotation description
@Cron(minute="/5") Every 5 minutes
@Cron(minute="5") At the 5th minute of each hour
@Cron(minute="5", hour="8") 5 minutes past 8am every day
@Cron(minute="5", hour="8", dayOfWeek="0") 5 minutes past 8am every Sunday
@Cron(minute="5", hour="8", dayOfMonth="1") 5 minutes past 8am on first of each month
@Cron(minute="5", hour="8", dayOfMonth="1", month="1") 5 minutes past 8am on first of of January
@Cron(minute="/5", params="--user=barman") Every 5 minutes, with a custom param

Building the cron

You should run bin/console cronos:dump and review what the cron file would look after it has been updated. If everything looks ok you can replace your crontab by running the command below.

bin/console cronos:replace

You can also limit which commands are included in the cron file by specifying a server, and it will then only show commands which are specified for that server.

Exporting the cron

bin/console cronos:dump --server=web
bin/console cronos:replace --server=web

Environment

You can choose which environment you want to run the commands in cron under like this.

bin/console cronos:replace --server=web --env=prod

Troubleshooting


Created by MyBuilder - Check out our blog for more insight into this and other open-source projects we release.


All versions of cronos-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.2
mybuilder/cronos Version ^3.0 || ^4.0
doctrine/annotations Version ^1.11
symfony/console Version ^4.4.20 || ^5.4 || ^6.0
symfony/config Version ^4.4.20 || ^5.4 || ^6.0
symfony/dependency-injection Version ^4.4.20 || ^5.4 || ^6.0
symfony/framework-bundle Version ^4.4.20 || ^5.4 || ^6.0
symfony/http-kernel Version ^4.4.20 || ^5.4 || ^6.0
symfony/property-access Version ^4.4.20 || ^5.4 || ^6.0
symfony/yaml Version ^4.4.20 || ^5.4 || ^6.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 mybuilder/cronos-bundle contains the following files

Loading the files please wait ....