Custom Connection Classes

By default, Skynet offers two connection methods:

- via cURL library
- via file_get_contents() function

You can create and add your own connection class by implementing:

/src/Skynet/SkynetConnectionInterface.php

and registering new class in factory:

/src/Skynet/SkynetConnectionsFactory.php

To register new connection provider class just add it to register method:

 
/**
* Registers all connection adapters into registry
*/
private function registerConnectors()
{
$this->register('file_get_contents', new SkynetConnectionFileGetContents());
$this->register('curl', new SkynetConnectionCurl());
}

After that you will need to set connection method in /src/SkynetUser/SkynetConfig.php file by changing option:

$config['core_connection_type']

Where option value is the name of connector defined in register method in factory.

Connection providers are placed in directory:
/src/Skynet/Connection/
Full API Documentation is included in Skynet packages available on GitHub.