PHP code example of gyron / net2web
1. Go to this page and download the library: Download gyron/net2web library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gyron / net2web example snippets
declare( strict_types=1 );
namespace Gyron\Sample;
use Gyron\Net2Web\Client;
use Gyron\Net2Web\Encryption;
use Gyron\Net2Web\Session;
/**
* Class AccessApiFactory
* @package Gyron\Sample
*/
class AccessApiFactory {
/**
* @var string
*/
private $sCachePath;
/**
* @param string $sCachePath
*/
public function __construct( string $sCachePath ) {
$this->sCachePath = $sCachePath;
}
/**
* @param array $aConfig er'], $aConfig['password'], $aConfig['host'], (string)$aConfig['port'], $oNet2Encryption, $sSessionId );
if ( $sSessionId != $oNet2Session->getSessionId() ) {
file_put_contents( $sCacheFile, trim( $oNet2Session->getSessionId() ) );
}
return ( new Client( $oNet2Session ) );
}
}