PHPackages                             cobwebinfo/cobra5-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. cobwebinfo/cobra5-php-sdk

ActiveLibrary

cobwebinfo/cobra5-php-sdk
=========================

PHP SDK for COBRA5

v4.0.0(1y ago)02.4k[1 PRs](https://github.com/cobwebinfo/cobra5-php-sdk/pulls)MITPHPPHP ^8.2CI failing

Since Apr 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/cobwebinfo/cobra5-php-sdk)[ Packagist](https://packagist.org/packages/cobwebinfo/cobra5-php-sdk)[ RSS](/packages/cobwebinfo-cobra5-php-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (3)Versions (36)Used By (0)

COBRA5 PHP SDK
==============

[](#cobra5-php-sdk)

[![Build Status](https://camo.githubusercontent.com/0a22618351a7a284b88b1efe2aa01ab3ab20cf2a731c2307146025441bb5f153/68747470733a2f2f7472617669732d63692e6f72672f636f62776562696e666f2f636f627261352d7068702d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cobwebinfo/cobra5-php-sdk)

[![Codacy Badge](https://camo.githubusercontent.com/a4c620848629e67c2aae5fbaf2895a2f47c5b8b2d8f4e31a4962fe8418564281/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3466666437313432633566373437383461376561626165366261616663376137)](https://www.codacy.com/app/jr-cobweb/cobra5-php-sdk?utm_source=github.com&utm_medium=referral&utm_content=cobwebinfo/cobra5-php-sdk&utm_campaign=Badge_Grade)

The COBRA5 API can be used to retrieve content from the [Cobweb Information Ltd](http://www.cobwebinfo.com) 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](http://www.cobwebinfo.com). You will also receive complete documentation on each of the resources of the COBRA5 API, as well as example requests and responses.

Installation
------------

[](#installation)

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

```
{
  "require": {
    "cobwebinfo/cobra5-php-sdk": "1.1.*"
  }
}
```

Authentication
--------------

[](#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:

```
$soap = new SoapClient('http://api.cobwebinfo.com/server/soap?wsdl');
```

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

```
use CobwebInfo\Cobra5Sdk\Authentication\SoapApiKeyAuthentication;

$auth = new SoapApiKeyAuthentication('Auth', 'api_key');
```

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

```
use CobwebInfo\Cobra5Sdk\Client\Cobra5SoapClient;

$client = new Cobra5SoapClient($soap, $auth);
```

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

```
use CobwebInfo\Cobra5Sdk\Cobra5;

$cobra5 = new Cobra5($client);
```

Return values
-------------

[](#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
-----------------

[](#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.

```
$cobra5->getStores();
```

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

```
$cobra5->getStore(9);
```

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

```
$cobra5->getStoreByName('BOP');
```

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

```
$cobra5->getDocuments();
```

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

```
$cobra5->getDocument(1444);
```

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

```
$cobra5->getLastEditedDocument();
```

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

```
$cobra5->getEditedDocuments('1388534400', '1391126400');
```

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

```
$cobra5->getDocumentsByDataStore(9);
```

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

```
$cobra5->getDocumentsForCategory(1197);
```

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

```
$cobra5->getCategory(1197);
```

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

```
$cobra5->getCategoriesForStore(9);
```

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

```
$cobra5->getDocumentXml(1444);
```

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

```
$cobra5->getDocumentPdf(1444);
```

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

```
$cobra5->getDocumentHtml(1444);
```

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

```
$cobra5->documentSearch('business', 0, 10);
```

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
---------------------

[](#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:

```
try
{
  $this->getDocument(999999999);
}

catch(SoapFault $e)
{
  // deal with error
}
```

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~116 days

Recently: every ~250 days

Total

34

Last Release

576d ago

Major Versions

v1.2.3.x-dev → v2.0.02020-08-28

v2.1.0 → v3.0.02023-09-14

v3.0.0 → v4.0.02024-10-10

PHP version history (5 changes)v1.0.0PHP &gt;=5.4.0

v2.0.0PHP &gt;=7.0.0

v2.0.7PHP ^7.3|^8.0

v2.1.0PHP ^8.0.2

v4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/73fea64422b09479ce931d520d58752180aa518c92e1e2af2c66a623780b3aad?d=identicon)[pbcobweb](/maintainers/pbcobweb)

![](https://www.gravatar.com/avatar/91a9ca6b12f4a5a0319ff9e03fa4a954d543599a23d2688dccd34d6f1cac462d?d=identicon)[jr-cobweb](/maintainers/jr-cobweb)

---

Top Contributors

[![jr-cobweb](https://avatars.githubusercontent.com/u/10956640?v=4)](https://github.com/jr-cobweb "jr-cobweb (30 commits)")[![pbcobweb](https://avatars.githubusercontent.com/u/7373739?v=4)](https://github.com/pbcobweb "pbcobweb (28 commits)")[![johnrich85](https://avatars.githubusercontent.com/u/1577555?v=4)](https://github.com/johnrich85 "johnrich85 (4 commits)")[![alex-cobweb](https://avatars.githubusercontent.com/u/31353794?v=4)](https://github.com/alex-cobweb "alex-cobweb (1 commits)")[![AlexSalam](https://avatars.githubusercontent.com/u/15808326?v=4)](https://github.com/AlexSalam "AlexSalam (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cobwebinfo-cobra5-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/cobwebinfo-cobra5-php-sdk/health.svg)](https://phpackages.com/packages/cobwebinfo-cobra5-php-sdk)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
