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:

  1. /src/Skynet/SkynetConnectionInterface.php

and registering new class in factory:

  1. /src/Skynet/SkynetConnectionsFactory.php

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

  1. /**
  2. * Registers all connection adapters into registry
  3. */
  4. private function registerConnectors()
  5. {
  6. $this->register('file_get_contents', new SkynetConnectionFileGetContents());
  7. $this->register('curl', new SkynetConnectionCurl());
  8. }

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

  1. $config['core_connection_type']

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

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