PHPackages                             gyron/net2web - 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. [API Development](/categories/api)
4. /
5. gyron/net2web

ActiveLibrary[API Development](/categories/api)

gyron/net2web
=============

Net2Web Client Library

v1.0.2(8y ago)51382MITPHPPHP &gt;=7.1

Since Jul 28Pushed 8y ago3 watchersCompare

[ Source](https://github.com/gyron/net2web)[ Packagist](https://packagist.org/packages/gyron/net2web)[ Docs](http://www.gyron.net)[ RSS](/packages/gyron-net2web/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

net2web
=======

[](#net2web)

PHP client library for [Net2Web](http://akostyra.net/index.php/net2web.html).

About
-----

[](#about)

Net2, by [Paxton](https://www.paxton.co.uk), is an access control systems developer and provider. Their software runs on Windows and does have an SDK (in .NET), however it does not have a remotely accessible API of any sort. Net2Web runs alongside Net2 and exposes ~90% of the SDK functionality as an XML web accessible API.

This library aims to simply integration with the Net2Web exposed API.

Installation Instructions
-------------------------

[](#installation-instructions)

### Composer

[](#composer)

Via command line simply do:

```
composer require gyron/net2web

```

Alternatively you can update the `"require": {` section in your `composer.json` with a line reading:

```
"gyron/net2web" : "v1.0.2"

```

Usage
-----

[](#usage)

### Quick Start

[](#quick-start)

Simply copy and paste the following code, and adjust the values:

```
$oNet2Encryption = new \Gyron\Net2Web\Encryption( 'ENCRYPTION KEY', \Gyron\Net2Web\Encryption::OpenSSL );
$oNet2Session = new \Gyron\Net2Web\Session( 'USERID', 'PASSWORD', 'NET2 SERVER IP', '7070', $oNet2Encryption );
$oNet2Client = new \Gyron\Net2Web\Client( $oNet2Session );

```

This will get you connected immediately, however it will create a new Net2Web session for **every request**.
It is recommended that you use `$oNet2Session->getSessionId()`, and cache this somewhere (for up to 2 to 4 hours). This can then be reused by passing the Session ID back into the Session instance:
`new Session( ..., ..., ..., ..., $oEncryption $sessionId );`

### Advanced Implementation

[](#advanced-implementation)

Following is a sample implementation of the library in the form of a service factory which utilises caching of the session ID to local storage.

```
