Download the PHP package gigasavvy/liteview-api without Composer

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

Liteview API

StyleCI Build Status Latest Stable Version Total Downloads Latest Unstable Version

Liteview API is a PHP wrapper around the Liteview REST API. It provides a lightweight and flexible interface for communicating with Liteview's ecommerce fulfillment services.

Installation

Install via composer:

Basic Usage

To make a connection to the API, create a new instance of Liteview\Connection, passing in your username and appkey credentials to the constructor:

Behind the scenes, an HTTP client is created with the proper headers and data needed to successfully access the API. To make calls to the API, simply call the supported HTTP verbs as methods of the Connection class. The first parameter is the resource URI to access. The second (optional) parameter is the body to send with the request. This should be a valid XML string.

XML Sucks

XML in a REST API is like hamburgers at a Mexican restaurant. Unfortunately, Liteview uses XML for the request and response payload. Fortunately, this package utilizes the Gestalt Configuration Package, allowing you to define default XML configurations and modify them as objects before sending a request.

To get started, head over to the Liteview API Documentation for examples of the XML payload for each resource. You can copy these exmaples into individual XML files and edit them as you would like. Once you have defined the default skeleton of your XML request(s), it is likely you will want to dynamically populate/modify different nodes of the XML document. This is where the Liteview\Api\Resources\Resource class comes in.

The Resource class extends the Gestalt\Configuration object and is intended to represent your XML payloads as a Gestalt Configuration object. It defines an additional toXml() method which you should call before passing it to an API request. Let's look at an example of using the Resource class to prepare a resource request:

Here we can see a full example of creating a Resource object from an XML file using the power of Gestalt's Custom Loaders. We can then use any of the Gestalt Configuration methods to modify our XML configuration before finally sending it off to the connection's post method.

With this flexibility we can define our XML once and modify it at runtime without worrying about XML syntax or the headache of working directly with a SimpleXMLElement or the like. Have a look at Gestalt's documentation for more information on using the package.

Appendix

Helpers

The Liteview API package defines some global helper functions that may be used as well.


array_to_xml() takes an associative array of XML data and parses it into the given SimpleXMLElement.


xml_to_array() takes a UTF-8 encoded XML string or object and converts it into an associative array.


is_assoc() takes an array and determines whether it is associative or not.


Conclusion

More features and documentation coming soon.


All versions of liteview-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.2
samrap/gestalt Version ^0.3.1
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 gigasavvy/liteview-api contains the following files

Loading the files please wait ....