Topvisor SDK: PHP

topvisorSDK v2 (zip)

System requirements

  • PHP 5.4 or above
  • cURL (php libcurl)

Getting started

Important!

  • Place SDK outside the website root
  • Restrict external access to the config.php file (e.g. using a browser address bar)

For the safety reasons, do not proceed to the next steps, until you complete the above steps.

Specify authorization parameters in the config.php file:


Access

Namespace SDK: TopvisorSDK\V2.

Linking SDK files to your scripts:

<?php use TopvisorSDK\V2 as TV; // replace "..." with a path to the autoload.php file if you use composer include(__DIR__.'/../../autoload.php'); // write a path to SDK Topvisor, if you don't use composer //include_once('topvisor-sdk/src/V2/Fields.php'); //include_once('topvisor-sdk/src/V2/Page.php'); //include_once('topvisor-sdk/src/V2/Pen.php'); //include_once('topvisor-sdk/src/V2/Session.php'); use TopvisorSDK\V2 as TV;

Basic objects

  • Session - set session
  • Fields - additional class to work with the fields
  • Pen - create request
  • Page - results page

Example