Download the PHP package pdeans/miva-provision without Composer

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

This package is abandoned and no longer maintained.

Miva Remote Provision

PHP library consisting of a full toolkit for interacting with Miva's remote provisioning module. The library components include tools for creating Miva provision xml markup, sending provision xml requests, and capturing provision xml responses.

Installation

Install via Composer.

Usage

First, create a new "Provision" manager instance. The manager instance takes 3 required parameters:

  1. Store Code - Store Settings > Store Code
  2. XML Request URL - Domain Settings > Remote Provisioning > XML Request URL
  3. Access Token - Domain Settings > Remote Provisioning > Access Token

Once the manager instance has been created, it may be used to generate provision xml markup, as well as send provision requests.

Creating Provision XML Tags

The library utilizes the simple and extensive pdeans XML Builder package to easily generate Miva provisioning tags.

Using The Provision Tag Builder

The create method is used to generate a provision xml tag. The create method takes the name of the root element (provisioning tag name) as the first argument, and an associative array consisting of the data to build the root attribute elements and/or child elements as the second argument.

Here is a simple example:

This will produce the following xml:

Parent/Child Elements

Notice how the array key-values function under the @tags array from the above example. The keys represent the xml element names, and the values represent the xml element values. Child tags can also be nested following this pattern with the parent element represented by the array key, and the array value consisting of an array of the child elements as key-value pairs. This pattern can be repeated as needed to nest subsequent child elements.

Element Value Helpers

The cdata helper method can be used to wrap an element value in a <![CDATA[]]> tag, while the decimal helper method can be used to format a decimal number into a standard decimal format, rounding to 2 decimals by default and stripping out commas. The decimal helper method accepts an optional second parameter to set the precision.

Reserved Keys

The @tags key represents one of 3 reserved keys (each containing shortcut key counterparts) that the xml builder uses to parse and generate the xml. The reserved keys are as follows:

@attributes Key Shortcut: @a

The @attributes key is used to create xml element attributes. The @a key is also supported as a shortcut for the @attributes key.

Examples:

XML Produced:

@tags Key Shortcut: @t

The @tags key accepts an associative array of data to build the root element's children. The @t key is also supported as a shortcut for the @tags key.

Examples:

XML Produced:

@value Key Shortcut: @v

The @value key explicitly sets an xml element value. Generally, this is only required on xml elements that require both attributes and a value to be set. The @v key is also supported as a shortcut for the @value key.

Examples:

XML Produced:

Note that the @tags key is used on the first level only of the associative array of tag data, as it represents the child tag data, while the other two reserved keys can be used on any sub-level throughout the associative array.

Repeated Tags

Sometimes repeated tags are used in xml, which does not play nice with associative array key-value pairs. To circumvent this, the element name is still passed as the array key, however, the array value consists of a sequential array of arrays with the tag data.

XML Produced:

Self-closing Tags

To generate a self-closing element without attributes, pass a value of null as the array value.

XML Produced:

Sending Provision Requests

Provision requests are sent via the send method.

By default, the send method will automatically prepend the Store (with the current store code) and Provision tags to the xml data passed to the method. If you wish for the functionality to be ommited, simply pass true as the second parameter.

Append Tag Helpers

The following append helpers can be used to help prepare the provision request xml for sending. As noted above, the send method will call the addStore and addProvision helper methods by default to auto-prepare the xml data before sending.

Provision Responses

A response object is returned with each provision request via the send method. The response object is an instance of the Zend Framework's Diactoros response object, which implements the PSR-7 HTTP message interface.

Helper Methods

The manager instance also includes helper methods to easily return or swap out the store code, request url, or access token as needed. Helper method examples:

Version Notes

Version 2 currently requires PHP 5.4 or higher, however, version 1 can be used if support for PHP 5.3 is required.


All versions of miva-provision with dependencies

PHP Build Version
Package Version
Requires php Version ^5.4 || ^7.0 || ^8.0
pdeans/http Version ^1.1
pdeans/xml-builder Version ^1.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 pdeans/miva-provision contains the following files

Loading the files please wait ....