CodeIgniter For Project : Workshop 002 - Config CodeIgniter

10
CodeIgniter For Project Workshop 002 : Config CodeIgniter Weerayut Hongsa : Network Engineer / Software Developer Major Kantana Broadcasting Co., Ltd https://kusumotolab.com

Transcript of CodeIgniter For Project : Workshop 002 - Config CodeIgniter

Page 1: 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

Page 2: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

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

Page 3: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

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)

Page 4: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

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

Page 5: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

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

Page 6: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

• $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

Page 7: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

• ['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

Page 8: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

• [‘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

Page 9: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

• $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

Page 10: CodeIgniter For Project : Workshop 002 - Config CodeIgniter

Forward to Lesson 104

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

https://kusumotolab.com