Skip to content

Commit a4f8920

Browse files
Merge pull request chriskacerguis#554 from softwarespot/exceptions
Throw exceptions than exit
2 parents 8dfa23a + a89db04 commit a4f8920

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
@@ -381,13 +381,13 @@ public function __construct($config = 'rest')
381381
if (is_php('5.4') === FALSE)
382382
{
383383
// CodeIgniter 3 is recommended for v5.4 or above
384-
exit('Using PHP v' . PHP_VERSION . ', though PHP v5.4 or greater is required');
384+
throw new Exception('Using PHP v' . PHP_VERSION . ', though PHP v5.4 or greater is required');
385385
}
386386

387387
// Check to see if this is CI 3.x
388388
if (explode('.', CI_VERSION, 2)[0] < 3)
389389
{
390-
exit('REST Server requires CodeIgniter 3.x');
390+
throw new Exception('REST Server requires CodeIgniter 3.x');
391391
}
392392

393393
// Set the default value of global xss filtering. Same approach as CodeIgniter 3

0 commit comments

Comments
 (0)