CodeIgniter For Project : Workshop 002 - Config CodeIgniter

Post on 18-Jan-2017

372 views 2 download

Transcript of CodeIgniter For Project : Workshop 002 - Config CodeIgniter

CodeIgniter For ProjectWorkshop 002 : Config CodeIgniter

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

Configuration First time

• application/config/config.php

• application/config/database.php

• application/config/route.php

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

application/config/config.php

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

Push encryption key (for use encryption function)

application/config/config.php• $config['sess_driver'] : Driver for use in

session function.

• $config['sess_cookie_name'] : Session Name.

• $config['sess_expiration'] : Session Expiration (Second)

• $config['sess_save_path'] : The location to save sessions to, driver dependent.

• $config['sess_time_to_update'] : How many seconds between CI regenerating the session ID.

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

application/config/config.phpCREATE TABLE IF NOT EXISTS `ci_sessions` (

`id` varchar(40) NOT NULL,

`ip_address` varchar(45) NOT NULL,

`timestamp` int(10) unsigned DEFAULT 0 NOT NULL,

`data` blob NOT NULL,

KEY `ci_sessions_timestamp` (`timestamp`)

);

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

• $config[‘cookie_prefix'] : Set a cookie name prefix

• $config[‘cookie_domain'] : Set to .your-domain.com for site-wide cookies

• $config[‘cookie_secure'] : Cookie will only be set if a secure HTTPS connection exists.

• $config[‘cookie_httponly'] : Cookie will only be accessible via HTTP(S) (no javascript)

application/config/config.php

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

• ['hostname'] : The hostname of your database server.

• ['username'] : The username used to connect to the database

• ['password'] : The password used to connect to the database

• [‘database'] : The name of the database you want to connect to

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

application/config/database.php

• [‘dbdriver'] : The database driver. e.g.: mysqli.

application/config/database.php

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

• $route[‘default_controller'] : This route indicates which controller class should be loaded if the URI contains no data.

application/config/route.php

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com

Forward to Lesson 104

Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd

https://kusumotolab.com