CI 묻고 답하기

제목 Linux에서 Windows로 옮긴뒤 시스템 라이브러리 로드 안되는 문제
글쓴이 간세 작성시각 2013/08/09 16:16:06
댓글 : 4 추천 : 0 스크랩 : 0 조회수 : 12593   RSS
Linux 에서 개발을 진행하다가 .. (잘되고 있었습니다.)
- apache2 + php 5.2.17


소스 그대로 Windows로 옮겼습니다. 
- apache2 + php 5.2.9-2

windows로 옮긴 이후로 문제가 생겼는데요.
컨트롤러 안에서 라이르러리 로드가 안되네요.

class Welcome extends CI_Controller {
 public function index() {
  $this->load->library('pagination');
  var_dump($this->pagination);
 }
}

화면에는 Undefined property: Welcome::$pagination 라는 에러와 함께 NULL 이 표시됩니다.

그런데, application/libraries 안에 만들어놓은 Custom Library 는 무난하게 load가 된다는겁니다.

위의 컨트롤러 메소드가 수행될때의 로그 함께 기재합니다.

DEBUG - 2013-08-09 16:17:54 --> Config Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Hooks Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Utf8 Class Initialized
DEBUG - 2013-08-09 16:17:54 --> UTF-8 Support Enabled
DEBUG - 2013-08-09 16:17:54 --> URI Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Router Class Initialized
DEBUG - 2013-08-09 16:17:54 --> No URI present. Default controller set.
DEBUG - 2013-08-09 16:17:54 --> Output Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Security Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Input Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Global POST and COOKIE data sanitized
DEBUG - 2013-08-09 16:17:54 --> Language Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Loader Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Config file loaded: application/config/config_mine.php
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: url_helper
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: html_helper
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: string_helper
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: debug_helper
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: date_helper
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: code_helper
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: cookie_helper
DEBUG - 2013-08-09 16:17:54 --> Helper loaded: permission_helper
DEBUG - 2013-08-09 16:17:54 --> Database Driver Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Session Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Encrypt Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Session routines successfully run
DEBUG - 2013-08-09 16:17:54 --> Model Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Model Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Controller Class Initialized
DEBUG - 2013-08-09 16:17:54 --> Pagination Class Initialized
ERROR - 2013-08-09 16:17:54 --> Severity: Notice  --> Undefined property: Welcome::$pagination E:\lib\application\controllers\welcome.php 6
DEBUG - 2013-08-09 16:17:54 --> Final output sent to browser
DEBUG - 2013-08-09 16:17:54 --> Total execution time: 0.1871

도와주세요 ㅠㅠ


태그 load,library,라이브러리,윈도우즈,windows
 다음글 함수 실행 관련해서 문의 드립니다. (2)
 이전글 에러 질문입니다. (4)

댓글

들국화 / 2013/08/09 16:36:56 / 추천 0

 function __construct()
 {
  parent::__construct();
 }


생성자 에서 컨트롤러 부모를 초기화 하지 않아서 그런듯 하네요.
테스트 해보지는 않아서.. ㅡㅡ;
 

수야디벨 / 2013/08/09 19:22:48 / 추천 0
 음 .. 왠지 들국화님 말이 맞는 듯 ;;

생성자 초기는 가장 기본 
간세 / 2013/08/09 21:07:57 / 추천 0
 자식클래스에 생성자 없으면, 부모 클래스 생성자를 자동 수행 하지 않나요 ?

물론, 자식 클래스에서 
function __construct()
{
 parent::__construct();
}
넣어봤습니다.
그래도 마찬가지네요 ...

위의 로그를 보면,

Pagination Class Initialized 
라고 Pagination 라이브러리가 생성됐다고 나오긴 하는데..머지..;;

간세 / 2013/08/09 21:36:21 / 추천 0
 라이브러리 로드 후 $this->pagination 은 존재하지 않지만,
$CI =& get_instance();
$CI->pagination
은 정상 동작하네요 ;;

class Welcome extends CI_Controller {
 public function index()
 {
  $this->load->library('pagination');
  var_dump($this->pagination); // Error
  $CI =& get_instance();
  var_dump($CI->pagination);   // OK
  exit;
 }
}