Beispiel #1
0
 /**
  * Constructor
  *
  * @param   JRegistry  $params  The module parameters
  *
  * @since   3.0
  */
 public function __construct($params)
 {
     // Store the module params
     $this->params = $params;
     // Start setting up the BDHttp connector
     $transport = null;
     // Set up our JRegistry object for the BDHttp connector
     $options = new JRegistry();
     // Set the user agent
     $options->set('userAgent', 'TweetDisplayBack/3.0');
     // Use a 30 second timeout
     $options->set('timeout', 30);
     // Include the BabDev library
     JLoader::registerPrefix('BD', __DIR__ . '/libraries');
     // If the user has forced a specific connector, use it, otherwise allow BDHttpFactory to decide
     $connector = $this->params->get('overrideConnector', null);
     // If the override is 'no', set to null
     if ($connector == 'no') {
         $connector = null;
     }
     // Instantiate our BDHttp object
     $this->connector = BDHttpFactory::getHttp($options, $connector);
     // Instantiate the bearer token
     $this->bearer = new BDBearer($this->params, $this->connector);
     // Store the requested URL scheme
     $this->scheme = JUri::getInstance()->getScheme();
 }