2014. 5. 28. 17:42

application/config/config.php

새로운 플러그인이나 리소스를 추가할 때 이를 위해 새로운 디렉토리를 추가해야 할 수도 있다.

이 추가한 특정 리소스를 CI BASEPATH 변수를 이용해 프로젝트의 최상위 루트로부터 상대적

위치로 참조.

$path = BASEPATE . ”bootstrap/hello.png”;

 

config.php

CI의 주요 설정 방식: $config[‘base_url’] = ‘’;

CI 컨트롤러나 메소드에 대한 URI 경로 문자열에 인덱스 페이지를 포함시키고 싶다면

$config[‘index_page’] = ‘index.php’;

http://mysite.com/fci/index.php/management/show

http://mysite.com/fci/management/show

 

/생성/ .htaccess 파일

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

 

RewriteRule ^(.*)$ index.php/S1 [L]

 

<Files "index.php">

AcceptPathInfo On

</Files>

 

/수정/ $config['index_page'] = '';

 

다중 언어 지원을 위해 각 뷰 파일의 html 헤더에 추가

<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8” />

 

$config['enable_hooks'] = FALSE;

TRUE – application/hooks 디렉토리에 정의한 후크를 작동시킬 수 있다.

 

$config[‘allow_get_array'] = TRUE;

컨트롤러 클래스의 메소드를 매개변수와 함께 호출할 수 있다.

index.php/my_handler/calc/5/7

 

$config[‘enable_query_strings'] = FALSE;

GET 방식의 URL 질의 문자열을 사용할 수 있는지 정의

컨트롤러의 클래스 매소드를 GET 방식의 URL 질의 문자열 안의 매개변수와 함께 호출할 수 있다.

index.php/my_handler/calc.php?a=5&b=7

 

$config[‘log_threshold'] = 4;

0 – 로그 기능 비활성

1 – 에러 메시지

2 – 디버그 메시지

3 – 정보서 메시지

4 – 모든 메시지

$config[‘log_path'] = ‘’;

기본 로그 파일은 application/logs에 기록

 

$config[‘encryption_key'] = ‘’;

세션 클래스의 서비스를 이용하려 할 때 설정.

 

$config[‘encryption_key'] = ‘abcdefghijklmnopqrstuvwxyz0123456789’;

$this->session->set_usrdata(‘this_user_id’, $uid);

$uid = $this->session->userdata(‘this_user_id’);

 

$config[‘sess_use_database'] = FALSE;

TRUE – 관련 데이터베이스에 크기가 큰 여러 세션 변수를 저장해야 한다는 의미

 

$config[‘sess_expiration'] = 7200;

세션 유효 기간 설정

 

$config[‘global_xss_filtering'] = TRUE;

사이트 간 스크립팅 XSS cross-site scripting 필터링 활성화/비활성화

 

$config[‘csrf_protection'] = FALSE;

사이트간 요청 위조 (CSRF/XSRF – Cross-Site Request Forgery) 공격 차단.

위조된 폼 전송시 위험.