Skip to content

Commit ac033c4

Browse files
committed
User defined configuration file.
Make it possible to specify which configuration file to use when extending this class, in my example we have a pretty complex system where we have two different interfaces, where different groups of end users will use different authentication methods, one will use session based and another will use basic authentication, with this change you could enable that behaviour.
1 parent 06f94ac commit ac033c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

application/libraries/REST_Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,15 @@ protected function early_checks()
192192
* Constructor function
193193
* @todo Document more please.
194194
*/
195-
public function __construct()
195+
public function __construct($config = 'rest')
196196
{
197197
parent::__construct();
198198

199199
// Start the timer for how long the request takes
200200
$this->_start_rtime = microtime(true);
201201

202202
// Lets grab the config and get ready to party
203-
$this->load->config('rest');
203+
$this->load->config($config);
204204

205205
// This library is bundled with REST_Controller 2.5+, but will eventually be part of CodeIgniter itself
206206
$this->load->library('format');

0 commit comments

Comments
 (0)