/
init.php
37 lines (32 loc) · 971 Bytes
/
init.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php defined('SYSPATH') or die('No direct script access.');
if (Kohana::$errors)
{
// Override Kohana exception handler
set_exception_handler(array('prophet', 'exception_handler'));
}
// Error Route for internal error requests
Route::set('prophet_error', 'prophet_error/<action>(/<message>)', array('action' => '[0-9]{3}', 'message' => '.*'))
->defaults(array(
'controller' => 'error',
));
// Catch All Route (404 Response)
Route::set('prophet_catchall', '<catchall>', array('catchall' => '.*'))
->defaults(array(
'controller' => 'error',
'action' => '404',
));
/**
* Helper function for set/get once data
*
* @param string Name of data
* @param mixed Data to be stored
* @return mixed Returns data if no value set
*/
function Flash($name, $value = NULL)
{
if ($value === NULL)
{
return Session::instance()->get_once($name);
}
Session::instance()->set($name, $value);
}