Changeset 2003
- Timestamp:
- 02/08/2008 07:19:05 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 3 removed
- 7 modified
-
application/config/config.php (modified) (1 diff)
-
application/controllers/additional_examples (deleted)
-
application/views/viewinview (deleted)
-
index.php (modified) (5 diffs)
-
system/core/Bootstrap.php (modified) (4 diffs)
-
system/core/Kohana.php (modified) (2 diffs)
-
system/helpers/cookie.php (modified) (1 diff)
-
system/libraries/Controller.php (modified) (1 diff)
-
system/libraries/Loader.php (deleted)
-
system/libraries/Session.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/application/config/config.php
r1937 r2003 62 62 $config['modules'] = array 63 63 ( 64 // 'modules/auth', // Authentication65 // 'modules/forge', // Form generation66 // 'modules/kodoc', // Self-generating documentation67 // 'modules/media', // Media caching and compression64 // MODPATH.'auth', // Authentication 65 // MODPATH.'forge', // Form generation 66 // MODPATH.'kodoc', // Self-generating documentation 67 // MODPATH.'media', // Media caching and compression 68 68 ); 69 70 /**71 * Libraries and models to be automatically preloaded into every controller. Use72 * a comma-separated list to set multiple items.73 */74 $config['preload'] = array75 (76 'libraries' => '',77 'models' => '',78 ); -
trunk/index.php
r1631 r2003 2 2 /** 3 3 * This file acts as the "front controller" to your application. You can 4 * configure your application and system directories here, as well as error5 * reporting and error display.4 * configure your application, modules, and system directories here. 5 * PHP error_reporting level may also be changed. 6 6 * 7 7 * @package Core … … 12 12 13 13 /** 14 * Kohana website application directory. This directory should contain your15 * applicationconfiguration, controllers, models, views, and other resources.14 * Website application directory. This directory should contain your application 15 * configuration, controllers, models, views, and other resources. 16 16 * 17 17 * This path can be absolute or relative to this file. … … 20 20 21 21 /** 22 * Kohana package files. This directory should contain the core/ directory, and 23 * the resources you included in your download of Kohana. 22 * Kohana modules directory. This directory should contain all the modules used 23 * by your application. Modules are enabled and disabled by the application 24 * configuration file. 25 * 26 * This path can be absolute or relative to this file. 27 */ 28 $kohana_modules = 'modules'; 29 30 /** 31 * Kohana system directory. This directory should contain the core/ directory, 32 * and the resources you included in your download of Kohana. 24 33 * 25 34 * This path can be absolute or relative to this file. 26 35 */ 27 36 $kohana_system = 'system'; 37 28 38 29 39 /** … … 50 60 * sure that your environment is compatible with Kohana, you can disable this. 51 61 */ 52 version_compare(PHP_VERSION, '5. 1.3', '<') and exit('Kohana requires PHP 5.1.3or newer.');62 version_compare(PHP_VERSION, '5.2', '<') and exit('Kohana requires PHP 5.2 or newer.'); 53 63 54 64 // … … 64 74 // Define application and system paths 65 75 define('APPPATH', str_replace('\\', '/', realpath($kohana_application)).'/'); 76 define('MODPATH', str_replace('\\', '/', realpath($kohana_modules)).'/'); 66 77 define('SYSPATH', str_replace('\\', '/', realpath($kohana_system)).'/'); 67 78 68 79 // Clean up 69 unset($kohana_application, $kohana_ system);80 unset($kohana_application, $kohana_modules, $kohana_system); 70 81 71 82 (is_dir(APPPATH) AND is_dir(APPPATH.'/config')) or die -
trunk/system/core/Bootstrap.php
r1522 r2003 11 11 */ 12 12 13 define('KOHANA_VERSION', '2. 1');14 define('KOHANA_CODENAME', ' Schneefeier');13 define('KOHANA_VERSION', '2.2'); 14 define('KOHANA_CODENAME', 'efímera'); 15 15 16 16 // Kohana benchmarks are prefixed by a random string to prevent collisions … … 20 20 require SYSPATH.'core/Benchmark'.EXT; 21 21 22 // Start :total_execution22 // Start total_execution 23 23 Benchmark::start(SYSTEM_BENCHMARK.'_total_execution'); 24 24 25 // Start :kohana_loading25 // Start kohana_loading 26 26 Benchmark::start(SYSTEM_BENCHMARK.'_kohana_loading'); 27 27 28 // Define Kohana error constant29 defined('E_KOHANA') or define('E_KOHANA', 42);30 // Define 404 error constant31 defined('E_PAGE_NOT_FOUND') or define('E_PAGE_NOT_FOUND', 43);32 // Define database error constant33 defined('E_DATABASE_ERROR') or define('E_DATABASE_ERROR', 44);34 // Define extra E_RECOVERABLE_ERROR for PHP < 5.235 defined('E_RECOVERABLE_ERROR') or define('E_RECOVERABLE_ERROR', 4096);36 28 // Load core files 37 29 require SYSPATH.'core/utf8'.EXT; … … 41 33 require SYSPATH.'core/Kohana'.EXT; 42 34 43 // End: kohana_loading 35 // Prepare the environment 36 Kohana::setup(); 37 38 // End kohana_loading 44 39 Benchmark::stop(SYSTEM_BENCHMARK.'_kohana_loading'); 45 40 46 // Start :system_initialization41 // Start system_initialization 47 42 Benchmark::start(SYSTEM_BENCHMARK.'_system_initialization'); 48 43 … … 50 45 Event::run('system.routing'); 51 46 52 // End :system_initialization47 // End system_initialization 53 48 Benchmark::stop(SYSTEM_BENCHMARK.'_system_initialization'); 54 49 -
trunk/system/core/Kohana.php
r1899 r2003 51 51 // Start the environment setup benchmark 52 52 Benchmark::start(SYSTEM_BENCHMARK.'_environment_setup'); 53 54 // Define Kohana error constant 55 defined('E_KOHANA') or define('E_KOHANA', 42); 56 57 // Define 404 error constant 58 defined('E_PAGE_NOT_FOUND') or define('E_PAGE_NOT_FOUND', 43); 59 60 // Define database error constant 61 defined('E_DATABASE_ERROR') or define('E_DATABASE_ERROR', 44); 53 62 54 63 // Disable error reporting … … 1105 1114 1106 1115 } // End Kohana 404 Exception 1107 1108 /**1109 * Run Kohana setup to prepare the environment.1110 */1111 Kohana::setup(); -
trunk/system/helpers/cookie.php
r1967 r2003 47 47 $expire = ($expire == 0) ? 0 : time() + (int) $expire; 48 48 49 // Only set httponly if possible 50 return (version_compare(PHP_VERSION, '5.2', '>=')) 51 ? setcookie($prefix.$name, $value, $expire, $path, $domain, $secure, $httponly) 52 : setcookie($prefix.$name, $value, $expire, $path, $domain, $secure); 49 return setcookie($prefix.$name, $value, $expire, $path, $domain, $secure, $httponly); 53 50 } 54 51 -
trunk/system/libraries/Controller.php
r1762 r2003 23 23 // Set the instance to the first controller loaded 24 24 Kohana::$instance = $this; 25 26 // Loader should always be available27 $this->load = new Loader;28 25 29 26 // Loader should always be available -
trunk/system/libraries/Session.php
r2002 r2003 130 130 131 131 // Set the session cookie parameters 132 // Note: the httponly parameter was added in PHP 5.2.0 133 if (version_compare(PHP_VERSION, '5.2', '>=')) 134 { 135 session_set_cookie_params 136 ( 137 self::$config['expiration'], 138 Config::item('cookie.path'), 139 Config::item('cookie.domain'), 140 Config::item('cookie.secure'), 141 Config::item('cookie.httponly') 142 ); 143 } 144 else 145 { 146 session_set_cookie_params 147 ( 148 self::$config['expiration'], 149 Config::item('cookie.path'), 150 Config::item('cookie.domain'), 151 Config::item('cookie.secure') 152 ); 153 } 132 session_set_cookie_params 133 ( 134 self::$config['expiration'], 135 Config::item('cookie.path'), 136 Config::item('cookie.domain'), 137 Config::item('cookie.secure'), 138 Config::item('cookie.httponly') 139 ); 154 140 155 141 // Register non-native driver as the session handler
