Download the PHP package tomwalder/polyfill-appengine-google-cloud-tasks without Composer

On this page you can find all versions of the php package tomwalder/polyfill-appengine-google-cloud-tasks. 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 polyfill-appengine-google-cloud-tasks

Polyfill for Google AppEngine Tasks to Google Cloud Tasks API

Snazzy title, I know.

If you are doing this on AppEngine PHP 5.5 runtime:

or this...

Then this library will allow that code to work outside of AppEngine, providing a polyfill to using the new Google Cloud Tasks API.

This is a stepping stone to upgrading to PHP 7 standard runtime, Flexible runtime - or better still, Cloud Run.

Installation & Setup

Pull in the library with Composer

You'll need to configure the location (region) where your Cloud Tasks queues are. Usually do this once in your bootstrap code.

Authentication

Your application will need credentials to call the Google Cloud Tasks API. This is usually handled automatically with Default Credentials, from GCP instances etc.

If you need to specify the path manually, do something like this...

Alternatively, you can configure and inject your own Google\Cloud\Tasks\V2\CloudTasksClient as follows. See Google Client Authentication for information about authenticating.

Absolute Task URLs (Cloud Run)

If you are using this library on Cloud Run, or GCP instances (i.e. outside of AppEngine), HTTP push task URLs are no longer relative.

So you will need to set the base HTTP target - all your relative task URLs will be appended to this.

Usage

Essentially, you can do most things using the original Google PushTask and PushQueue classes. See above for examples.

Further Information

Bulk Add

Google Cloud Tasks does not support bulk-adding, so the polyfill adds each task one after the other for you.

You may notice some increase in latency. Also, in rare cases you may get an error part way through the task enqueueing process. This will result in some, but not all, of your tasks being created.

Specify Project ID Manually

You can specify the Google Project ID manually as follows (we try and extract from the credentials):

Performance

It is strongly recommended to use the gRPC and Protobuf extensions to get the best performance out of all Google APIs.

The default is REST unless the above are available. The Google Auth stack auto-detects.

Those extensions are available in the Google App Engine PHP 7 runtime and can be enabled in php.ini

Force Queues

If you want to be able to use new Queue names without worrying about creating the queues yourself, you can enable as follows:

This will check to see a Queue exists before inserting tasks, and attempt to create it.

This may increase latency and is probably not sensible for production use.

External Links

Credits

Some parts of this code borrowed from: https://github.com/GoogleCloudPlatform/appengine-php-sdk


All versions of polyfill-appengine-google-cloud-tasks with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
ext-bcmath Version *
google/cloud-tasks Version ^v1.8
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 tomwalder/polyfill-appengine-google-cloud-tasks contains the following files

Loading the files please wait ....