forked from mixu/useradmin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.php
35 lines (31 loc) · 1.19 KB
/
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
<?php defined('SYSPATH') or die('No direct access allowed.');
Route::set('user/provider', 'user/provider(/<provider>)', array('provider' => '.+'))
->defaults(array(
'controller' => 'user',
'action' => 'provider',
'provider' => NULL,
));
Route::set('user/provider_return', 'user/provider_return(/<provider>)', array('provider' => '.+'))
->defaults(array(
'controller' => 'user',
'action' => 'provider_return',
'provider' => NULL,
));
// Static file serving (CSS, JS, images)
Route::set('css', '<dir>(/<file>)', array('file' => '.+', 'dir' => '(css|img)'))
->defaults(array(
'controller' => 'user',
'action' => 'media',
'file' => NULL,
'dir' => NULL,
));
/**
* Set the default database to test database when testing env is detectd
*/
if( class_exists("Unittest_tests") &&
(Unittest_tests::enabled() && ( ( isset($_SERVER['REQUEST_URI']) && strtolower( substr( $_SERVER['REQUEST_URI'], 0, 13) ) == '/unittest/run') || Kohana::$is_cli ) && Kohana::config('database.unittest'))
)
{
// FIXME remove URI check for config test database
Kohana::config('database')->set( "default", Kohana::config('database.'.Kohana::config('unittest.db_connection')) );
}