php - 无法重新声明 class api异常 Google+ api
php - Cannot redeclare class apiException Google+ api
我收到这个错误:
Fatal error: Cannot redeclare class apiException in E:\Applications\xampp\htdocs\onlineshop\application\third_party\google-login-api\apiClient.php on line 367
这是什么意思?
我应该怎么做才能解决它?在我的控制器或其他任何地方添加异常?
请帮助我。
这是我的代码
public function gplus_login(){
if(isset($_GET['code'])){
$this->googleplus->getAuthenticate();
$user_profile2 = $this->googleplus->getUserInfo();
$username2 = $user_profile2['email'];
$password2 = $user_profile2['email'];
$member_status2 = 1;
$result2 = $this->m_member->check_login($username2, $password2, $member_status2);
if($result2 == TRUE){
$user2 = $this->m_member->by_id(array('member_username'=>$username2));
$newdata2 = (array(
'username_front' => $username2,
'member_id' => $user2->member_id,
'member_fullname' => $user2->member_fullname,
'logged_in_front' => TRUE
));
$this->session->set_userdata($newdata2);
redirect('home');
}
else{
$data2 = array(
'member_gplus_id' => $user_profile2["id"],
'member_fullname' => $user_profile2["name"],
'member_email' => $user_profile2["email"],
'member_username' => $user_profile2["email"],
'member_password' => md5($user_profile2["email"]),
'member_status' => 1,
'member_isreseller' => 0,
'member_login' => 0,
'created_by' => $user_profile2["name"],
'created_on' => date('Y-m-d H:i:s'));
$this->m_member->insert($data2);
$user3 = $this->m_member->by_id(array('member_username'=>$username2));
$newdata3 = (array(
'username_front' => $username2,
'member_id' => $user3->member_id,
'member_fullname' => $user3->member_fullname,
'logged_in_front' => TRUE
));
$this->session->set_userdata($newdata3);
redirect("account");
}
}
else{
$this->session->set_flashdata("Login Error");
redirect("home");
}
}
我认为 apiException
在源代码中被包含超过 1 次。
确保它在您的源代码中仅使用一次。
我收到这个错误:
Fatal error: Cannot redeclare class apiException in E:\Applications\xampp\htdocs\onlineshop\application\third_party\google-login-api\apiClient.php on line 367
这是什么意思?
我应该怎么做才能解决它?在我的控制器或其他任何地方添加异常?
请帮助我。
这是我的代码
public function gplus_login(){
if(isset($_GET['code'])){
$this->googleplus->getAuthenticate();
$user_profile2 = $this->googleplus->getUserInfo();
$username2 = $user_profile2['email'];
$password2 = $user_profile2['email'];
$member_status2 = 1;
$result2 = $this->m_member->check_login($username2, $password2, $member_status2);
if($result2 == TRUE){
$user2 = $this->m_member->by_id(array('member_username'=>$username2));
$newdata2 = (array(
'username_front' => $username2,
'member_id' => $user2->member_id,
'member_fullname' => $user2->member_fullname,
'logged_in_front' => TRUE
));
$this->session->set_userdata($newdata2);
redirect('home');
}
else{
$data2 = array(
'member_gplus_id' => $user_profile2["id"],
'member_fullname' => $user_profile2["name"],
'member_email' => $user_profile2["email"],
'member_username' => $user_profile2["email"],
'member_password' => md5($user_profile2["email"]),
'member_status' => 1,
'member_isreseller' => 0,
'member_login' => 0,
'created_by' => $user_profile2["name"],
'created_on' => date('Y-m-d H:i:s'));
$this->m_member->insert($data2);
$user3 = $this->m_member->by_id(array('member_username'=>$username2));
$newdata3 = (array(
'username_front' => $username2,
'member_id' => $user3->member_id,
'member_fullname' => $user3->member_fullname,
'logged_in_front' => TRUE
));
$this->session->set_userdata($newdata3);
redirect("account");
}
}
else{
$this->session->set_flashdata("Login Error");
redirect("home");
}
}
我认为 apiException
在源代码中被包含超过 1 次。
确保它在您的源代码中仅使用一次。