Advertisement
Guest User

Untitled

a guest
Jan 4th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.30 KB | None | 0 0
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3.  
  4.  
  5.  
  6. require SYSPATH.'classes/kohana/core'.EXT;
  7.  
  8. if (is_file(APPPATH.'classes/kohana'.EXT))
  9. {
  10.    
  11.     require APPPATH.'classes/kohana'.EXT;
  12. }
  13. else
  14. {
  15.    
  16.     require SYSPATH.'classes/kohana'.EXT;
  17. }
  18.  
  19.  
  20. date_default_timezone_set('Europe/Sarajevo');
  21.  
  22.  
  23. setlocale(LC_ALL, 'en_US.utf-8');
  24.  
  25.  
  26. spl_autoload_register(array('Kohana', 'auto_load'));
  27.  
  28.  
  29. ini_set('unserialize_callback_func', 'spl_autoload_call');
  30.  
  31.  
  32.  
  33.  
  34. I18n::lang('en-us');
  35.  
  36.  
  37. if (getenv('KOHANA_ENV') !== FALSE)
  38. {
  39.     Kohana::$environment = constant('Kohana::'.strtoupper(getenv('KOHANA_ENV')));
  40. }
  41.  
  42.  
  43. Kohana::init(array(
  44.     'base_url'      => '/',
  45.     'caching'       => FALSE,
  46.     'cache_life'    => 60,
  47.     'charset'       => 'utf-8',
  48.     'errors'        => TRUE,
  49.     'index_file'    => FALSE,
  50.     'profile'       => TRUE,
  51. ));
  52.  
  53.  
  54. Kohana::$log->attach(new Log_File(APPPATH.'logs'));
  55.  
  56.  
  57. Kohana::$config->attach(new Config_File);
  58.  
  59.  
  60. Kohana::modules(array(
  61.     'codebench'     => MODPATH.'codebench',    
  62.     'auth'          => MODPATH.'auth',             
  63.     'cache'         => MODPATH.'cache',            
  64.     'database'      => MODPATH.'database',         
  65.     'image'         => MODPATH.'image',            
  66.     'orm'           => MODPATH.'orm',              
  67.     'pagination'    => MODPATH.'pagination',       
  68.     'unittest'      => MODPATH.'unittest',         
  69.     'userguide'     => MODPATH.'userguide',    
  70.     'purifier'      => MODPATH.'purifier',     
  71.     'html_parser'   => MODPATH.'html_parser',  
  72.     'phpquery'      => MODPATH.'phpquery',     
  73.     'less'          => MODPATH.'less',         
  74.     'jsmin'         => MODPATH.'jsmin',        
  75.     'sitemap'       => MODPATH.'sitemap',      
  76.     'youtube'       => MODPATH.'youtube',      
  77.     'facebook'      => MODPATH.'facebook',     
  78.     'oauth'         => MODPATH.'oauth',
  79. ));
  80.  
  81.    
  82. Route::set('archive', 'arhiva(/<date>)', array('date' => '([1-31]{2})/([1-12]{2})/([0-9]{4})'))
  83.     ->defaults(array(
  84.         'controller'    =>  'archive',
  85.         'action'        =>  'index',
  86.         'date'          =>  NULL,
  87.     ));
  88.    
  89. Route::set('flash', 'article/flash(/<id>)', array('id'=>'[0-9]+'))
  90.     ->defaults(array(
  91.         'controller'    =>  'article',
  92.         'action'        =>  'flash',
  93.         'id'            =>  NULL,
  94.     ));
  95.  
  96. Route::set('article', '<id>(/<seo>)', array('id'=>'[0-9]+','seo'=>'.+'))
  97.     ->defaults(array(
  98.         'controller'    =>  'article',
  99.         'action'        =>  'index',
  100.     ));
  101.    
  102. Route::set('category', 'kategorija(/<seo>(/<article_id>))', array('article_id'=>'[0-9]+'))
  103.     ->defaults(array(
  104.         'controller'    =>  'category',
  105.         'article_id'    =>  NULL,
  106.     ));
  107.    
  108. Route::set('archive' ,'arhiva(/<date>)(/<category_seo>)', array('date'=>'[0-9\.]+'))
  109.     ->defaults(array(
  110.         'controller'    =>  'archive',
  111.         'date'          =>  NULL,
  112.         'category_seo'  =>  NULL,
  113.     ));
  114.    
  115. Route::set('static', 's/<action>(/<file>)',array('file'=>'.+'))
  116.     ->defaults(array(
  117.         'controller'    =>  'static',
  118.     ));
  119.    
  120. Route::set('topic', 'tema/<seo>')
  121.     ->defaults(array(
  122.         'controller'    =>  'topic',
  123.     ));
  124.    
  125. Route::set('content', 'sadrzaj(/<kategorija>)')
  126.     ->defaults(array(
  127.         'controller'    =>  'content',
  128.     ));
  129.    
  130. Route::set('user', '<action>', array('action'=>'login|logout|registracija'))
  131.     ->defaults(array(
  132.         'controller'    =>  'user',
  133.         'action'        =>  'login',
  134.     ));
  135.    
  136. Route::set('sitemap_index', 'sitemap.xml(<gzip>)', array('gzip' => '\.gz'))
  137.     ->defaults(array(
  138.         'controller' => 'sitemap',
  139.         'action' => 'index'
  140.     ));
  141.  
  142. Route::set('default', '(<controller>(/<action>(/<id>(/<seo>))))')
  143.     ->defaults(array(
  144.         'controller' => 'index',
  145.         'action'     => 'index',
  146.     ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement