Download the PHP package a5hleyrich/wp-queue without Composer

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

WP Queue

Total Downloads Latest Stable Version License

Job queues for WordPress.

Install

The recommended way to install this library in your project is by loading it through Composer:

It is highly recommended to prefix wrap the library class files using PHP-Scoper, to prevent collisions with other projects using this same library.

Prerequisites

WP_Queue requires PHP 7.3+.

The following database tables need to be created:

Alternatively, you can call the wp_queue_install_tables() helper function to install the tables. If using WP_Queue in a plugin you may opt to call the helper from within your register_activation_hook.

Jobs

Job classes should extend the WP_Queue\Job class and normally only contain a handle method which is called when the job is processed by the queue worker. Any data required by the job should be passed to the constructor and assigned to a public property. This data will remain available once the job is retrieved from the queue. Let's look at an example job class:

Dispatching Jobs

Jobs can be pushed to the queue like so:

You can create delayed jobs by passing an optional second parameter to the push method. This job will be delayed by 60 minutes:

Cron Worker

Jobs need to be processed by a queue worker. You can start a cron worker like so, which piggy backs onto WP cron:

You can also specify the number of times a job should be attempted before being marked as a failure.

Restricting Allowed Job Classes

The queue will handle any subclass of WP_Queue\Job. For better security, it is strongly recommended that the DatabaseConnection be instantiated with a list of allowed Job subclasses that are expected to be handled.

You can do that by passing in an array of Job subclasses when the Queue sets up its database connection, or by having a database connection that only handles certain Job subclasses.

Local Development

When developing locally you may want jobs processed instantly, instead of them being pushed to the queue. This can be useful for debugging jobs via Xdebug. Add the following filter to use the sync connection.

Contributing

Contributions are welcome via Pull Requests, but please do raise an issue before working on anything to discuss the change if there isn't already an issue. If there is an approved issue you'd like to tackle, please post a comment on it to let people know you're going to have a go at it so that effort isn't wasted through duplicated work.

Unit & Style Tests

When working on the library, please add unit tests to the appropriate file in the tests directory that cover your changes.

Setting Up

We use the standard WordPress test libraries for running unit tests.

Please run the following command to set up the libraries:

Substitute db_name, db_user and db_pass as appropriate.

Please be aware that running the unit tests is a destructive operation, database tables will be cleared, so please use a database name dedicated to running unit tests. The standard database name usually used by the WordPress community is wordpress_test, e.g.

Please refer to the Initialize the testing environment locally section of the WordPress Handbook's Plugin Integration Tests entry should you run into any issues.

Running Unit Tests

To run the unit tests, simply run:

If the composer dependencies aren't in place, they'll be automatically installed first.

Running Style Tests

It's important that the code in the library use a consistent style to aid in quickly understanding it, and to avoid some common issues. PHP_Code_Sniffer is used with mostly standard WordPress rules to help check for consistency.

To run the style tests, simply run:

If the composer dependencies aren't in place, they'll be automatically installed first.

Running All Tests

To make things super simple, just run the following to run all tests:

If the composer dependencies aren't in place, they'll be automatically installed first.

Creating a PR

When creating a PR, please make sure to mention which GitHub issue is being resolved at the top of the description, e.g.:

Resolves #123

The unit and style tests will be run automatically, the PR will not be eligible for merge unless they pass, and the branch is up-to-date with master.

License

WP Queue is open-sourced software licensed under the MIT license.


All versions of wp-queue with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
nesbot/carbon Version ^2.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 a5hleyrich/wp-queue contains the following files

Loading the files please wait ....