fork download
  1. <?php
  2. <?php defined('SYSPATH') or die('No direct script access.');
  3.  
  4. // -- Environment setup --------------------------------------------------------
  5.  
  6. // Load the core Kohana class
  7. require SYSPATH.'classes/Kohana/Core'.EXT;
  8.  
  9. if (is_file(APPPATH.'classes/Kohana'.EXT))
  10. {
  11. // Application extends the core
  12. require APPPATH.'classes/Kohana'.EXT;
  13. }
  14. else
  15. {
  16. // Load empty core extension
  17. require SYSPATH.'classes/Kohana'.EXT;
  18. }
  19.  
  20. /**
  21.  * Set the default time zone.
  22.  *
  23.  * @link http://k...content-available-to-author-only...k.org/guide/using.configuration
  24.  * @link http://w...content-available-to-author-only...p.net/manual/timezones
  25.  */
  26. #date_default_timezone_set('America/Chicago');
  27. date_default_timezone_set('Asia/Yekaterinburg');
  28.  
  29. /**
  30.  * Set the default locale.
  31.  *
  32.  * @link http://k...content-available-to-author-only...k.org/guide/using.configuration
  33.  * @link http://w...content-available-to-author-only...p.net/manual/function.setlocale
  34.  */
  35. setlocale(LC_ALL, 'en_US.utf-8');
  36.  
  37. /**
  38.  * Enable the Kohana auto-loader.
  39.  *
  40.  * @link http://k...content-available-to-author-only...k.org/guide/using.autoloading
  41.  * @link http://w...content-available-to-author-only...p.net/manual/function.spl-autoload-register
  42.  */
  43. spl_autoload_register(array('Kohana', 'auto_load'));
  44.  
  45. /**
  46.  * Optionally, you can enable a compatibility auto-loader for use with
  47.  * older modules that have not been updated for PSR-0.
  48.  *
  49.  * It is recommended to not enable this unless absolutely necessary.
  50.  */
  51. //spl_autoload_register(array('Kohana', 'auto_load_lowercase'));
  52.  
  53. /**
  54.  * Enable the Kohana auto-loader for unserialization.
  55.  *
  56.  * @link http://w...content-available-to-author-only...p.net/manual/function.spl-autoload-call
  57.  * @link http://w...content-available-to-author-only...p.net/manual/var.configuration#unserialize-callback-func
  58.  */
  59. ini_set('unserialize_callback_func', 'spl_autoload_call');
  60.  
  61. // -- Configuration and initialization -----------------------------------------
  62.  
  63. /**
  64.  * Set the default language
  65.  */
  66. I18n::lang('en-us');
  67. #I18n::lang('ru-ru');
  68. /**
  69.  * Set Kohana::$environment if a 'KOHANA_ENV' environment variable has been supplied.
  70.  *
  71.  * Note: If you supply an invalid environment name, a PHP warning will be thrown
  72.  * saying "Couldn't find constant Kohana::<INVALID_ENV_NAME>"
  73.  */
  74. # PRODUCTION готовый проект
  75. # STAGING подготовка
  76. # TESTING тестирование
  77. # DEVELOPMENT разработка
  78.  
  79. Kohana::$environment=Kohana::DEVELOPMENT;
  80. if (isset($_SERVER['KOHANA_ENV']))
  81. {
  82. Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
  83. }
  84.  
  85. /**
  86.  * Initialize Kohana, setting the default options.
  87.  *
  88.  * The following options are available:
  89.  *
  90.  * - string base_url path, and optionally domain, of your application NULL
  91.  * - string index_file name of your index file, usually "index.php" index.php
  92.  * - string charset internal character set used for input and output utf-8
  93.  * - string cache_dir set the internal cache directory APPPATH/cache
  94.  * - integer cache_life lifetime, in seconds, of items cached 60
  95.  * - boolean errors enable or disable error handling TRUE
  96.  * - boolean profile enable or disable internal profiling TRUE
  97.  * - boolean caching enable or disable internal caching FALSE
  98.  * - boolean expose set the X-Powered-By header FALSE
  99.  */
  100. Kohana::init(array(
  101. 'base_url' => '/kohana/',
  102. 'index_file' => false,
  103. 'errors' => TRUE
  104. ));
  105.  
  106. /**
  107.  * Attach the file write to logging. Multiple writers are supported.
  108.  */
  109. Kohana::$log->attach(new Log_File(APPPATH.'logs'));
  110.  
  111. /**
  112.  * Attach a file reader to config. Multiple readers are supported.
  113.  */
  114. Kohana::$config->attach(new Config_File);
  115.  
  116. /**
  117.  * Enable modules. Modules are referenced by a relative or absolute path.
  118.  */
  119. Kohana::modules(array(
  120. // 'auth' => MODPATH.'auth', // Basic authentication
  121. // 'cache' => MODPATH.'cache', // Caching with multiple backends
  122. // 'codebench' => MODPATH.'codebench', // Benchmarking tool
  123. // 'database' => MODPATH.'database', // Database access
  124. // 'image' => MODPATH.'image', // Image manipulation
  125. // 'minion' => MODPATH.'minion', // CLI Tasks
  126. // 'orm' => MODPATH.'orm', // Object Relationship Mapping
  127. // 'unittest' => MODPATH.'unittest', // Unit testing
  128. // 'userguide' => MODPATH.'userguide', // User guide and API documentation
  129. 'twig' => MODPATH.'twig', // Twig templating engine
  130. 'pagination' => MODPATH.'pagination', // Pagination
  131. 'menu' => MODPATH.'menu', // Navigation1
  132. //'navigation' => MODPATH.'navigation', // Navigation
  133. ));
  134.  
  135. /**
  136.  * Set the routes. Each route must have a minimum of a name, a URI and a set of
  137.  * defaults for the URI.
  138.  */
  139. // Route::set('about', 'about')
  140. // ->defaults(array(
  141. // 'controller' => 'static',
  142. // 'action' => 'about',
  143. // ));
  144. // Route::set('contacts', 'contacts')
  145. // ->defaults(array(
  146. // 'controller' => 'static',
  147. // 'action' => 'contacts',
  148. // ));
  149. Route::set('static','<action>(/<id>)',array('action'=>'about|contacts'))
  150. ->defaults(array(
  151. 'controller' => 'static',
  152. ));
  153. Route::set('comments', 'comments/<id>',array('id'=>'.+'))
  154. ->defaults(array(
  155. 'controller' => 'comments',
  156. 'action' => 'index',
  157. ));
  158. /*Route::set('articles', 'articles(/<id>)',array('id'=>'.+'))
  159. ->defaults(array(
  160. 'controller' => 'articles',
  161. 'action' => 'index',
  162. ));*/
  163. Route::set('category', 'category(/<name>(/<page>))',array('name' => '[a-zA-Z_-]+','page'=>'[0-9]+')) // проблемное место
  164. ->defaults(array(
  165. 'controller' => 'category',
  166. 'action' => 'index',
  167. ));
  168. Route::set('articles', 'articles(/page/<num>)',array('num' => '[0-9]+'))
  169. ->defaults(array(
  170. 'controller' => 'articles',
  171. 'action' => 'index',
  172. ));
  173. Route::set('default', '(<controller>(/<action>(/<id>)))')
  174. ->defaults(array(
  175. 'controller' => 'index',
  176. 'action' => 'index',
  177. ));
  178. Cookie::$salt = 'foobar';
  179. // your code goes here
Runtime error #stdin #stdout #stderr 0.01s 20592KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected '<' in /home/iApw28/prog.php on line 2