Download the PHP package cobwebinfo/cobra5-php-sdk without Composer

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

COBRA5 PHP SDK

Build Status

Codacy Badge

The COBRA5 API can be used to retrieve content from the Cobweb Information Ltd content API.

This repository contains the open source PHP SDK for integrating the COBRA5 API into your PHP application. The COBRA5 PHP SDK is licensed under the MIT license.

This package requires PHP >= 7.0.0. Please refer to version 1.0.x if you are using older versions of PHP.

In order to gain access to the COBRA5 API, you will require an API Key that will be issued by Cobweb Information Ltd. You will also receive complete documentation on each of the resources of the COBRA5 API, as well as example requests and responses.

Installation

Add cobwebinfo/cobra5-php-sdk as a requirement to composer.json:

Authentication

The COBRA5 API is based on open standards known collectively as web services, which includes Simple Object Access Protocal (SOAP), Web Services Definition Language (WSDL) and the XML Schema Definition Language (XSD).

In order to authenticate with the COBRA5 API, you will need to create a SoapClient and set the correct authorisation header. This can be achieved using the service classes within this repository:

First, create a new SoapClient and pass the URI of the WSDL:

Next, create a new SoapApiKeyAuthentication object and pass the name of the SoapHeader and your api_key as arguments:

Next, create a new Cobra5SoapClient and pass the SoapClient and SoapApiKeyAuthentication objects as arguments:

Finally, create a new instance of Cobra5 and pass the Cobra5SoapClient object as the argument:

Return values

Each of the methods of the COBRA5 PHP SDK will return either a collection or an entity.

A collection is an iteratable object that implements a numer of helper methods for working with collections of resources. The collection will be an instance of Illuminate\Support\Collection.

Each entity has a number of methods that make working with entity objects easier. Certain entities also have additional helper methods. You can find the entity classes under CobwebInfo\Cobra5Sdk\Entity.

Available methods

The following is a list of available methods and how you would call them on the $cobra5 object. For a more detailed overview of the methods, requests and responses of the COBRA5 API, please consult the documentation that was provided with your API key.

The getStores() method will return a Illuminate\Support\Collection of the datastores that you have access to through your API key.

The getStore() method will return a CobwebInfo\Cobra5Sdk\Entity\Datastore instance.

The getStoreByName() method will return a CobwebInfo\Cobra5Sdk\Entity\Datastore instance.

The getDocuments() method will return a Illuminate\Support\Collection of the documents that you have access to through your API key.

The getDocument() method will return a CobwebInfo\Cobra5Sdk\Entity\Document instance.

The getLastEditedDocument() method will return the last edited document in the system as a CobwebInfo\Cobra5Sdk\Entity\Document instance.

The getEditedDocuments() method will return a Illuminate\Support\Collection of documents that were edited between two unix timestamps.

The getDocumentsByDataStore() method will return a Illuminate\Support\Collection of documents that are available to you through a particular datastore.

The getDocumentsForCategory() method will return a Illuminate\Support\Collection of documents that are available to you through a particular category.

The getCategory() method will return a CobwebInfo\Cobra5Sdk\Entity\Category instance.

The getCategoriesForStore() method will return a Illuminate\Support\Collection of categories that are available to you through a particular datastore.

The getDocumentXml() method will return the XML version of a document as a string.

The getDocumentPdf() method will return the PDF version of a document as a base64 encoded string.

The getDocumentHtml(1444) method will return the HTML version of a document as a string.

The documentSearch() method will allow you to search the API for a particular term. You will be returned a Illuminate\Support\Collection of results.

Errors and Exceptions

If a problem occurs whilst using the COBRA5 API a SoapFault exception will be thrown. This exception can be caught and dealt with gracefully within your application:


All versions of cobra5-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.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 cobwebinfo/cobra5-php-sdk contains the following files

Loading the files please wait ....