Download the PHP package bundeling/artilleryphp without Composer

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

ArtilleryPhp

Artillery.io is a modern, powerful & easy-to-use performance testing toolkit.

ArtilleryPhp is a library to write and maintain Artillery scripts in PHP8.

Documentation contains:

Table of Contents

Installation

You can install the library via Composer:

This library requires the symfony/yaml package to render its internal arrays to a YAML format.

Usage

This example is available at examples/artilleryphp-usage.

Step 1: Create a new Artillery instance

You can use Artillery::new($target) to get a new instance, and use the fluent interface to set config values:

You can also create one from a full or partial array representation:

And from an existing YAML file, or other Artillery instance:

! Warning: The methods fromYaml and merge are not very well supported right now; fromYaml mostly works with outputs from this library; and merge will do nothing if second level keys are already defined (e.g. trying to merge a second environment).

Step 2: Define the flow of your scenario and add it to the Artillery instance:

Tips:

Plural versions exist to take multiple entries of raw array representations:

Take note of the difference between the set and add differentiation, and;
Refer to the Artillery reference docs for raw representation specs.

Step 3: Export to YAML:

This will produce the following readme-example.yml file:

Tips:

For a very basic script, you can also add Requests (single or array) directly to the Artillery instance to create a new Scenario out of it:

Notes

Current implementation builds up an internal array representation. This means that there's limited or no support for operations like getting a Scenario instance from a specific index or unsetting a property. For now think in terms of composition, and look forward to v2.


Artillery Class

The Artillery class has all the methods related to the config section of the Artillery script, along with adding scenarios.

Docs: https://bundeling.github.io/ArtilleryPhp/classes/ArtilleryPhp-Artillery

For custom config settings, there is a set(key: string, value: mixed) function available.

Target:

If a target is set, it will be used as the base Url for all the requests in the script.

You can either pass the base Url in the constructor or use the setTarget method on the Artillery instance. You can also skip this step entirely and provide fully qualified Urls in each Request.

Environments:

Environments can be specified with overrides for the config, such as the target URL and phases.

You can either use the config of another Artillery instance, or as an array of config values:

`

Static factory helpers: use these to get a new instance and immediately call methods on them:

Scenario-related methods:

You can add a fully built scenario, or pass a single Request or array of Requests, and a Scenario will be made from it.

See the Scenario Class for more details.

Processor & function hooks:

A scenario's flow, and requests, can have JavaScript function hooks that can read and modify context such as variables.

Here's a very demonstrative example from examples/generating-vu-tokens:

With ./helpers.js as:

See also Artillery.io docs for necessary function signatures.

Config settings:

Please refer to the docs: https://bundeling.github.io/ArtilleryPhp/classes/ArtilleryPhp-Artillery#methods

Rendering and Loading:


Scenario Class

The Scenario class includes all the methods related to a scenario and its flow.

Docs: https://bundeling.github.io/ArtilleryPhp/classes/ArtilleryPhp-Scenario

Methods:

Docs: https://bundeling.github.io/ArtilleryPhp/classes/ArtilleryPhp-Scenario#methods


Custom Scenario settings:


Adding to the flow from another scenario into this scenario:


Misc:


If not set, the engine defaults to HTTP requests. To create a WebSocket scenario, you need to specify this scenario's engine as 'ws' and only use instances of the WsRequest class, available at Artillery::wsRequest().


Scenario-level JavaScript function hook, from the Js file defined in setProcessor in the Artillery instance:

Similarly, for requests, there are scenario level hooks for before and after:

See Artillery.io docs for more details on js function hooks.


Flow methods:


Request Class

Docs: https://bundeling.github.io/ArtilleryPhp/classes/ArtilleryPhp-Request

The Request class has all the methods related to HTTP requests along with some shared methods inherited from a RequestBase class.

For WebSocket there is a crude implementation of the WsRequest class available at Artillery::wsRequest().

For custom requests AnyRequest is meant to be used anonymously with these functions:

Methods:

Please refer to the docs: https://bundeling.github.io/ArtilleryPhp/classes/ArtilleryPhp-Request#methods

Inherited:


All versions of artilleryphp with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/yaml Version ^5.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 bundeling/artilleryphp contains the following files

Loading the files please wait ....