Exemplo n.º 1
0
 /**
  * Constructor.
  *
  * @param string $clientid
  * @param string $clientsecret
  * @param moodle_url $returnurl
  * @param string $scope
  */
 public function __construct($clientid, $clientsecret, moodle_url $returnurl, $scope)
 {
     parent::__construct();
     $this->clientid = $clientid;
     $this->clientsecret = $clientsecret;
     $this->returnurl = $returnurl;
     $this->scope = $scope;
     $this->accesstoken = $this->get_stored_token();
 }
Exemplo n.º 2
0
 public function __construct($host = '', $apiDir = '')
 {
     parent::__construct($host, $apiDir);
     $this->setCurlTimeOut(300);
 }
Exemplo n.º 3
0
 public function __construct()
 {
     global $_M;
     parent::__construct();
     $this->set('file', 'index.php?n=platform&c=dl&a=dodlfile');
 }
Exemplo n.º 4
0
 /**
  * Constructor.
  *
  * @param string   $hostname
  * @param string   $clientid
  * @param string   $clientsecret
  * @param stdClass $accesstoken
  */
 public function __construct($hostname, $clientid = '', $clientsecret = '', $accesstoken = null)
 {
     parent::__construct();
     $this->_hostname = $hostname;
     $this->_apibaseurl = $this->_hostname . self::API_URL;
     $this->_clientid = $clientid;
     $this->_clientsecret = $clientsecret;
     if (empty($accesstoken)) {
         $this->_accesstoken = $this->get_new_token();
     } else {
         $this->_accesstoken = $accesstoken;
     }
 }