Changeset 433 for trunk/index.php

Show
Ignore:
Timestamp:
08/28/2007 09:21:22 PM (15 months ago)
Author:
Shadowhand
Message:

A few small changes:

  • Added more descriptive comments into index.php
  • Fixed another issue with Router, related to setting the default "index" method
  • Added Config::include_paths() function to retrieve the include paths
  • Updated files to use Config::include_paths() instead of Config::item('core.include_paths');
  • Updated config file to have usable defaults
  • Changed to using DIRECTORY_SEPARATOR instead of '/' for paths, to better accommodate Windows users
  • Removed all exception calls in favor of trigger_error (this will be changed to using only exceptions very shortly, but straight errors are easier for now)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r416 r433  
    11<?php 
     2/* 
     3| ----------------------------------------------------------------------------- 
     4| Kohana - The Swift PHP5 Framework 
     5| ----------------------------------------------------------------------------- 
     6| This file acts as the "front controller" to your application. If you do not 
     7| understand the configuration parameters below, please consult the Kohana 
     8| User Guide for more information. 
     9| ----------------------------------------------------------------------------- 
     10| User Guide: http://kohanaphp.com/user_guide/kohana/installation.html 
     11| ----------------------------------------------------------------------------- 
     12*/ 
    213 
    3 /** 
    4  * Turn on full error reporting 
    5  */ 
    6 error_reporting(E_ALL); ini_set('display_errors', TRUE); 
     14// Set the error reporting level 
     15@error_reporting(E_ALL); 
    716 
    8 /** 
    9  * Application Path 
    10  */ 
    11 $application_path = 'application'; 
     17// Enable or disable error reporting 
     18@ini_set('display_errors', TRUE); 
    1219 
    13 /** 
    14  * System Path 
    15  */ 
    16 $system_path = 'system'; 
     20// Kohana application directory 
     21$kohana_application = 'application'; 
    1722 
    18 /**** END CONFIGURATION ** DO NOT EDIT BELOW ****/ 
     23// Kohana system directory 
     24$kohana_system = 'system'; 
    1925 
    20 // Define absolute paths 
    21 define('APPPATH', realpath($application_path).'/'); 
    22 define('SYSPATH', realpath($system_path).'/'); 
    23 // More definitions 
     26/* 
     27| ----------------------------------------------------------------------------- 
     28| PLEASE DO NOT EDIT BELOW THIS LINE, unless you understand the repercussions! 
     29| ----------------------------------------------------------------------------- 
     30| User Guide: http://kohanaphp.com/user_guide/general/bootstrapping.html 
     31| ----------------------------------------------------------------------------- 
     32*/ 
     33// Absolute path names for include purposes 
     34define('APPPATH', realpath($kohana_application).DIRECTORY_SEPARATOR); unset($kohana_application); 
     35define('SYSPATH', realpath($kohana_system).DIRECTORY_SEPARATOR); unset($kohana_system); 
     36// Information about the front controller 
    2437define('KOHANA',  pathinfo(__FILE__, PATHINFO_BASENAME)); 
    25 define('DOCROOT', pathinfo(__FILE__, PATHINFO_DIRNAME).'/'); 
     38define('DOCROOT', pathinfo(__FILE__, PATHINFO_DIRNAME).DIRECTORY_SEPARATOR); 
    2639define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION)); 
    27  
    28 // Check APPPATH 
    29 (is_dir(APPPATH) AND is_dir(APPPATH.'/config')) or die 
     40// Validate APPPATH 
     41(is_dir(APPPATH) AND is_dir(APPPATH.DIRECTORY_SEPARATOR.'config')) or die 
    3042( 
    3143        'Your <code>$application_path</code> does not exist. '. 
    3244        'Set a valid <code>$application_path</code> in <kbd>index.php</kbd> and refresh the page.' 
    3345); 
    34  
    35 // Check SYSPATH 
    36 (is_dir(SYSPATH) AND file_exists(SYSPATH.'/core/Bootstrap'.EXT)) or die 
     46// Validate SYSPATH 
     47(is_dir(SYSPATH) AND file_exists(SYSPATH.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'Bootstrap'.EXT)) or die 
    3748( 
    38         'Your <code>$system_path</code> does not exist. '. 
    39         'Set a valid <code>$system_path</code> in <kbd>index.php</kbd> and refresh the page.' 
     49        'Your <code>$kohana_system</code> does not exist. '. 
     50        'Set a valid <code>$kohana_system</code> in <kbd>index.php</kbd> and refresh the page.' 
    4051); 
    41  
    4252// Buckle those bootstraps! 
    43 require_once SYSPATH.'core/Bootstrap'.EXT; 
     53require_once SYSPATH.'core'.DIRECTORY_SEPARATOR.'Bootstrap'.EXT;