FacebookRestClient::__construct PHP Method

__construct() public method

Create the client.
public __construct ( $api_key, $secret, string $session_key = null )
$session_key string if you haven't gotten a session key yet, leave this as null and then set it later by just directly accessing the $session_key member variable.
    public function __construct($api_key, $secret, $session_key = null)
    {
        $this->secret = $secret;
        $this->session_key = $session_key;
        $this->api_key = $api_key;
        $this->last_call_id = 0;
        $this->server_addr = Facebook::get_facebook_url('api') . '/restserver.php';
        if ($GLOBALS['facebook_config']['debug']) {
            $this->cur_id = 0;
            ?>
<script type="text/javascript">
var types = ['params', 'xml', 'php', 'sxml'];
function toggleDisplay(id, type) {
  for each (var t in types) {
    if (t != type || document.getElementById(t + id).style.display == 'block') {
      document.getElementById(t + id).style.display = 'none';
    } else {
      document.getElementById(t + id).style.display = 'block';
    }
  }
  return false;
}
</script>
<?php 
        }
    }

Usage Example

 public function __construct($api_key, $secret, $backend_api_key, $backend_secret_key, $backend_host, $backend_port, $backend_url, $canvas_url, $local_req_uri, $session_key = null)
 {
     parent::__construct($api_key, $secret, $session_key);
     $this->m_backend_api_key = $backend_api_key;
     $this->m_backend_secret_key = $backend_secret_key;
     $this->m_an = Analytics_Utils::instance($backend_api_key, $backend_secret_key, $backend_host, $backend_port, $backend_url, $canvas_url, $local_req_uri);
     //$this->m_an->set_ab_testing_mgr(new AB_Testing_Manager($backend_api_key, $backend_secret_key,
     //$ab_testing_host, $ab_testing_port ));
 }