2011-11-12 4 views
1

내 planner.php 및 shared.php 컨트롤러에 액세스 할 때 치명적인 오류가 발생합니다. 이견있는 사람?Ion Auth/CodeIgniter 치명적 오류

Fatal error: Uncaught exception 'Exception' with message 'Undefined method Ion_auth::get_user() called' in 
/application/libraries/Ion_auth.php:88 Stack trace: #0 

/application/core/MY_Controller.php(50): Ion_auth->__call('get_user', Array) #1 

/application/core/MY_Controller.php(50): Ion_auth->get_user() #2 

/application/controllers/user/planner.php(9): Common_Auth_Controller->__construct() #3 

/system/core/CodeIgniter.php(288): Planner->__construct() #4 /index.php(202): require_once('/Users/lrussell...') #5 {main} thrown in/application/libraries/Ion_auth.php on line 88 

라이브러리 확장 I는 이온 인증을 위해 사용하고 있습니다 : http://jondavidjohn.com/blog/2011/01/scalable-login-system-for-codeigniter-ion_auth

플래너 컨트롤러 : http://pastie.org/private/wc1bq6eiqb9hn8iubwdgq

공유 컨트롤러 : http://pastie.org/private/uj3ta8dw3jl7kqxizs9n1a

Ion_auth 도서관 라인 88 세그먼트 : http://pastie.org/private/mhgwdzjyhatwsdrux4gqpa

,210

CRUD 모델 : http://pastie.org/private/m2nhfqzabdsx5eiz6xqupw

이벤트 모델 : http://pastie.org/private/b6ksjoowl7wde9errow

공유 모델 : http://pastie.org/private/f741jfnf8o2l5oxphnrl5w

답변

2

음, 그것은 똑같은 일이 나에게 일어났다. 이 라이브러리의 최신 버전에서 Ben Edmunds는 PHP 마법 메서드 __call()을 사용하여 정규 구문 $this->ion_auth_model->method()을 사용하여 모델 메서드를 호출 할 필요가 없지만 대신 $this->ion_auth->method()을 사용하여 마치 라이브러리에 속한 메서드 인 것처럼 모델 메서드를 호출 할 필요가 없습니다.

하지만 실제로는 해당 메서드가 모델에 속합니다. 따라서 모델을 살펴보면 get_user() 메소드가없고 (라이브러리에도 없습니다!) 또는 적어도 내가 말하는 버전 (최신 또는 이전 버전)이 표시됩니다. 1 ~ 2 주 전에 새로운 사본을 다운로드했습니다). 그가 제공 한 문서에는 약간의 오류가 있다고 생각합니다. (그가했던 전반적인 작업은 Ben에게 경탄합니다.)

동일한 결과를 얻을 수있는 user() 모델 방법을 사용해 볼 수 있습니다 (더 가까운 기능입니다). 따라서 $this->ion_auth->user()으로 전화하여 귀하의 필요에 맞는 지보십시오.

$this->end_user = $this->ion_auth->user()->row(); 
+1

내가 이것을 확인할 수

가 ...이 대신 명확히하기 위해 편집 ...

$this->end_user = $this->ion_auth->current()->row(); 

이렇게 ..., 그리고 직접적으로 관련 라이브러리에 대한 최근의 커밋 https://github.com/benedmunds/CodeIgniter-Ion-Auth/commit/ef733edb5ef396fec57fe363c5c8616506054c79 – jondavidjohn

+0

그래, 버전이 w ebsite benedmunds.com/ion_auth는 오래된 파일이므로 github에서 파일을 직접 다운로드해야 제대로 작동합니다. 도와 주신 모든 분들께 감사드립니다! – imlouisrussell

관련 문제