Download the PHP package leadvertex/plugin-component-process without Composer

On this page you can find all versions of the php package leadvertex/plugin-component-process. 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 plugin-component-process

LeadVertex process plugin component

\Leadvertex\Plugin\Components\Process - component, which designed to store and provide information about the current state of the process based on the base DB model from DB plugin component and accepts process id into itself.

Installation

Usage

For example, you can create new process like this:

Note, that you need to use save() method to save actual information to DB.

Initialize method

Method initialize() is intended to indicate the number of entities being processed.\ It accepts a number of entities, to be handled. The number may be null for cases where you cannot determine its exact value.\ Note, that you must initialize process before you can use its handle(), skip() and finish() methods.\ You can check if the process has already been initialized with isInitialized() method.

Handle method

Method handle() is intended to increase the number of successfully processed entities.\ You can get current number of handled entities with getHandledCount() method.

Skip method

Method skip() is intended to skip processing of current entities. You can use it in cases, when your entity become inaccessible or was deleted during processing.\ You can get current number of skipped entities with getSkippedCount() method.

AddError method

Method addError() is intended to be used when handle of current entity fails.\ It accepts an instance of \Leadvertex\Plugin\Components\Process\Components\Error into itself. You can use it like this:

You can get list of 20 last errors with getLastErrors() method.

Terminate method

Method terminate() is intended to stop execution of process due to fatal error.\ It accepts an instance of \Leadvertex\Plugin\Components\Process\Components\Error into itself, adds an error in similar to addError() method way, marks handle of all remaining entities as failed, sets result of process execution as false and sets updatedAt property of model as the current DateTime.\ You can get result of the process execution with getResult() method.\ You can use this method like this:

Finish method

Method finish() is intended to be used when your process finished all its work.\ It accepts a result into itself which can be one of the 3 following types:

  1. bool - is used when you need to return final status of your process execution.
  2. int - is used when you need to return number of handled entities.
  3. string - is used when you need to return URI in result.

Also it sets result of process execution as the accepted value and sets updatedAt property of model as the current DateTime.

JsonSerializable

Process implements a built-in jsonSerializable interface, which means you can get process info as a serialized json by simply using json_encode to process instance. For example, you can use it like this:


All versions of plugin-component-process with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
ext-json Version *
leadvertex/plugin-component-db Version ^0.3.5
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 leadvertex/plugin-component-process contains the following files

Loading the files please wait ....