コード例 #1
0
ファイル: GuzzleHandler.php プロジェクト: BertschiAG/JRA
 /**
  * GuzzleHandler constructor.
  *
  * @param ConfigFacade|ConfigInterface $pConfig
  * @param InternalFactory $pFactory
  */
 public function __construct(ConfigInterface $pConfig, InternalFactory $pFactory)
 {
     $this->_config = $pConfig;
     $this->_factory = $pFactory;
     $this->_client = $this->_factory->getGuzzleFactory()->getHttpClientObject($this->_configurationOptions());
     $this->_client->addSubscriber($this->_factory->getGuzzleFactory()->getCookiePlugin());
 }
コード例 #2
0
ファイル: TokenLogin.php プロジェクト: BertschiAG/JRA
 /**
  * Each chain needs to fill this function with it's own actions.
  * This function contains the functionality of each chain.
  *
  * @param ConfigInterface $pConfig The configuration which is used to make the request.
  * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation.
  * @return bool|stdClass true if the request has been processed, false otherwise
  */
 protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory)
 {
     if ($pConfig->getAuthenticationMethod() !== Authenticate::AUTH_METHOD_TOKEN) {
         return false;
     }
     $token = $pConfig->getAuthenticationCredentials();
     return json_decode($pInternalFactory->getGuzzleFactory()->getGuzzleHandler()->get('token/' . $token)->getBody());
 }
コード例 #3
0
 /**
  * Each chain needs to fill this function with it's own actions.
  * This function contains the functionality of each chain.
  *
  * @param ConfigInterface $pConfig The configuration which is used to make the request.
  * @param InternalFactory $pInternalFactory The factory which is responsible for the internal object creation.
  * @return bool|stdClass true if the request has been processed, false otherwise
  */
 protected function process(ConfigInterface $pConfig, InternalFactory $pInternalFactory)
 {
     if ($pConfig->getAuthenticationMethod() !== Authenticate::AUTH_METHOD_USER_CREDENTIALS) {
         return false;
     }
     $userCredentials = $pConfig->getAuthenticationCredentials();
     $userSession = $pConfig->getSession();
     $response = json_decode($pInternalFactory->getGuzzleFactory()->getGuzzleHandler()->get('user/logout/' . $userCredentials['username'] . '/' . $userSession)->getBody());
     return $response;
 }
コード例 #4
0
ファイル: AbstractCommand.php プロジェクト: BertschiAG/JRA
 /**
  * Processes the method and calls Guzzle for requesting the URL.
  */
 public function process()
 {
     $httpMethod = $this->getHttpMethod();
     $this->_response = $this->_factory->getGuzzleFactory()->getGuzzleHandler()->{$httpMethod}($this->getParsedUrl(), $httpMethod === 'POST' || $httpMethod === 'PUT' ? $this->getAdditionalArguments() : null)->getBody(true);
 }
コード例 #5
0
ファイル: APIFacade.php プロジェクト: BertschiAG/JRA
 /**
  * Get the current logged in user.
  *
  * @return UserLogoutResponseObject Returns the response in an functionality providing object.
  */
 public function getCurrentUser()
 {
     $userCommand = $this->_internalFactory->getCommandFactory()->getUserCommand($this->_config, UserRoutes::GET_USER);
     $userCommand->run();
     return new MsgResponseObject($userCommand->getContents());
 }