Download the PHP package tomatom/jobqueuebundle without Composer

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

JobQueueBundle

Symfony bundle which aims to replace JMSJobQueueBundle for scheduling console commands, with complete browser interface.

Table of Contents

  1. Features
  2. Installation
  3. Configuration
    • Bundles
    • Routes
    • Messenger
    • Security
    • Job Queue
  4. Usage
    • Job Types
    • Creating Jobs Programmatically
    • Creating Jobs via Browser
  5. Testing
  6. Dependencies
  7. TODO
  8. Additional info / Contributing

Features

Installation

Configuration

config/bundles.php:


config/routes.yaml:


config/packages/messenger.yaml:

You can create your own transport for the job messages - or just use async transport


config/packages/security.yaml:

The bundle uses the role security system to control access for the jobs/command scheduling. You can assign roles based on the level of access you want to grant to each user.

Available roles are:

ROLE_JQB_ALL - The main role with full permissions. Provides unrestricted access to all features of the bundle.

ROLE_JQB_JOBS - Grants full permissions for jobs (JOB_ roles).

ROLE_JQB_COMMANDS - Grants full permissions for command scheduling (COMMAND_ roles).

ROLE_JQB_JOB_LIST - Allows access to view the job list.

ROLE_JQB_JOB_READ - Allows access to view job details.

ROLE_JQB_JOB_CREATE - Allows creating new jobs.

ROLE_JQB_JOB_DELETE - Allows deleting jobs.

ROLE_JQB_JOB_CANCEL - Allows canceling jobs.

ROLE_JQB_COMMAND_SCHEDULE - Allows scheduling commands.

(Also with constants in JobQueuePermissions.php)

To grant full access to users, add ROLE_JQB_ALL to the role hierarchy:

To restrict access for example to only viewing the job list and job details (without creation or scheduling), configure the roles like this:

Note - jobs creation is always possible where security has no loaded user, for example if created in a command.


config/packages/job_queue.yaml:

You do not have to create this file for the bundle to work, but you can edit some parameters

Update your database so the job tables are created

or via migrations.

Do not forget to run the messenger

This is up to you and where your project runs, but you need to have the messenger consuming the right transport for the bundle to work.

For recurring messages you also need the scheduler running so the jobs are created

Usage

Types of ways jobs can be run

Once job is created, Symfony messenger message is created which handles the run of the command from the job.

Manually creating the jobs in your application:

The function createCommandJob from CommandJobFactory accepts:

and returns the created job.

Basic example:

Adding a related entity:

Purpose of this is to filter jobs seen in the list by the related entity.

For example, if you have a Customer entity:

If you then go to the job list with parameters /job/list/Customer/1 (which is being automatically added if going from the detail with related entity) or if you add it to the list path yourself like:

then the job list only contains jobs for that given customer.

You can also only add the entity name to get all jobs for a given entity.

Adding a parent job:

Jobs can have another one as a parent job. One job can have multiple children jobs.

This can be used if for example you need to create a job that has to run after another job finishes.

(Recreating jobs also creates a new one with the original as a parent.)

If jobs have any children/parent there will be button links to them in the job detail (for parents also in job list).

Creating a postponed job:

If you want to set a command to run once in given time - set $startAt of type DateTimeImmutable

Creating / updating a recurring job:

Where both functions call the function saveRecurringCommandJob from CommandJobFactory, which accepts:

Saving values from the command output:

If you need to retrieve and save any data from the output of a command that is running from a job, you can do that by adding anything after constant Job::COMMAND_OUTPUT_PARAMS in the command output, for example:

This will output in the console OUTPUT PARAMS: 123 and the '123' will be saved in the job's outputParams, which can be then used for example to retrieve the customer entity.

Output params are saved in the database as a TEXT and you can save multiple values, which are then separated by a comma, for example:

this will be saved as '123, some text value, ab' and then you need to individually handle getting the values by what you've saved.

Creating jobs via the browser interface:

Available urls:

Schedule Command Job List Job Detail

Job detail gets updated automatically while the job is running.

All the pages are also responsive for mobile use.

Extending the templates can be done like this:

To change or add translations for a new locale, use translation variables from bundle's translations in your translations/messages.{locale}.yaml:

(Currently there are only translations for en and cs locales)

Testing

The bundle has ready tests for job creations in the tests/ folder. Running tests in your app can be done like this:

The tests are also run on every push / pull request on GitHub.

Dependencies

TODO

Handle getting changes of recurring jobs in better way

Additional info / Contributing

Special thanks to schmittjoh for the original JMSJobQueueBundle.

This bundle is not a fork, nor is building on top of the original bundle, it's our own take on the console command scheduling, so please bear that in mind when using it. However, going from the original to this bundle should be seamless.

Feel free to open any issues or pull requests if you find something wrong or missing what you'd like the bundle to have!


All versions of jobqueuebundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/doctrine-bundle Version ^2
doctrine/orm Version ^2|^3
dragonmantank/cron-expression Version ^3
knplabs/knp-paginator-bundle Version ^6
spiriitlabs/form-filter-bundle Version ^11|^10
symfony/form Version ^6.4 || ^7.2
symfony/framework-bundle Version ^6.4 || ^7.2
symfony/lock Version ^6.4 || ^7.2
symfony/messenger Version ^6.4 || ^7.2
symfony/process Version ^6.4 || ^7.2
symfony/scheduler Version ^6.4 || ^7.2
symfony/security-bundle Version ^6.4 || ^7.2
symfony/translation Version ^6.4 || ^7.2
twig/twig Version ^2|^3
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 tomatom/jobqueuebundle contains the following files

Loading the files please wait ....