public function getBaiduOAuth2Service() { if (!$this->oauth2) { $this->oauth2 = new BaiduOAuth2($this->clientId, $this->clientSecret); $this->oauth2->setRedirectUri($this->redirectUri); } return $this->oauth2; }