Download the PHP package bytespin/console-command-scheduler-bundle without Composer

On this page you can find all versions of the php package bytespin/console-command-scheduler-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 console-command-scheduler-bundle

Copyright (c) 2023 Greg LAMY [email protected]

This is a public project hosted on GitHub : https://github.com/ByteSpin/ConsoleCommandSchedulerBundle.git

This bundle was originally developed as part of an ETL project.

ByteSpin/ConsoleCommandSchedulerBundle is a Symfony 6.3 simple bundle that allows you to schedule console commands easily:

[!NOTE]

This project is still at beta state.

Feel free to submit bug and/or pull requests!

You can check the CHANGELOG to see the latest improvements and fixes.

Just keep in mind that I want to keep it as simple as possible!

[!IMPORTANT]

Version 1.0.13 requires schema update. Please run :

Requirements

Installation

  1. First install the bundle:

  2. Then update the database schema:

Updating the bundle

For now, the bundle still lacks a custom recipe to manage database schema upgrade when needed.

Do not forget to update the database schema when updating the bundle

The last version that includes schema modifications is : 1.0.13

Manual bundle registration

You will need to manually register the bundle in your application.

To do this, follow these steps:

  1. Open the file config/bundles.php in your Symfony application.

  2. Add the following line to the array returned by this file:

  3. Save the file. Your bundle is now registered and ready to be used in your application.

Make sure to perform this step after you have installed the bundle using Composer, but before you use any of its features in your application.

Configuration

You will have to configure the entity manager to be used with the ByteSpin\ConsoleCommandSchedulerBundle entities. This has to be done once after installation. We provide a script to automatise this step ; please run :

If you prefer to do this by yourself, add the following lines just within your entity manager 'mappings:' key in doctrine.yaml :

[!IMPORTANT]

If your project contains entities mapped to multiple entity managers, be careful to not use the auto_mapping: true in your doctrine configuration.

This would prevent the getManagerForClass() function used in the bundle to get the correct entity manager to work properly!

In such case :

  • Choose the correct entity manager when you run the configuration script,
  • Be sure to remove the 'auto_mapping: true' key from your doctrine.yaml (or set it to false),
  • Be sure that ALL your entities are correctly mapped in the 'mappings:' sections of your doctrine.yaml

Administration interface

[!NOTE]

Please note that the administration interface is based on EasyAdmin symfony bundle.

Because you might already use EasyAdmin in your project, no DashboardController is provided with the bundle.

If you don't have one, generate it with

You need to manually add the menu to your DashboardController.php file, for example:

(The previous lines make use of FontAwesome icons. You are free to use any other solution)

Usage

[!NOTE] The bundle makes use of the very new symfony/scheduler component that is said to be experimental on 6.3 symfony version

That will change in the forthcoming 6.4 release.

The only documentation available for the moment is on the official symfony blog, with some useful examples. Please read it carefully at https://symfony.com/blog/new-in-symfony-6-3-scheduler-component

The 'from_date', 'from_time', 'until_date', 'until_time' bundle parameters are used to construct the expected scheduler trigger

The administration interface provides two sections:

Consuming messages

The standard way of consuming scheduler messages is

If you want the command to be verbose, please use:

You can use cron or supervisor to achieve this ; The console commands are then executed according to the generated triggers.

The commands returning code, date and duration are logged in the dedicated table and in a dedicated log

You can view the logs in the administration interface

Events

New generic events are now dispatched by the bundle for deeper integration with your application and/or a notification system:

The event subject is normalized and contains all console command useful data.

Use ByteSpin events through an event subscriber with a simple mail notification example:

Notification system

A new notification system is now provided by the bundle that can be extended in your own console commands.

First, you will have to add a new environment variable in your project .env file: [email protected] Provide a valid mail from address. Do not forget to configure the mailer dsn in you project.

The bundle natively only send details about the main console command scheduled by the bundle. In some cases, your command can run several sub-steps for which you may need more details in notification. For this, the bundle provides a new event you can dispatch in your commands

That's it, you will get detailed notification in your mailbox!

Licence

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of console-command-scheduler-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
doctrine/doctrine-migrations-bundle Version ^3.2
symfony/validator Version ^7.1
symfony/messenger Version ^7.1
doctrine/orm Version ^2.10
symfony/flex Version ^2
symfony/framework-bundle Version ^7.1
easycorp/easyadmin-bundle Version ^4.6
symfony/scheduler Version ^7.1
symfony/process Version ^7.1
symfony/monolog-bundle Version ^3.10
ext-readline Version *
symfony/yaml Version ^7.1
symfony/lock Version ^7.1
dragonmantank/cron-expression Version ^3.3
symfony/mailer Version ^7.1
symfony/mime Version ^7.1
symfony/runtime Version ^7.1
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 bytespin/console-command-scheduler-bundle contains the following files

Loading the files please wait ....