Changeset 3400 for branches

Show
Ignore:
Timestamp:
08/30/2008 02:36:37 PM (3 months ago)
Author:
Shadowhand
Message:

Updated index.php for branches/website, fixes #811. Thanks bio!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/website/index.php

    r2785 r3400  
    5656/** 
    5757 * If you rename all of your .php files to a different extension, set the new 
    58  * extension here. This option can left to .php, even if this file is has a 
     58 * extension here. This option can left to .php, even if this file has a 
    5959 * different extension. 
    6060 */ 
     
    6464// DO NOT EDIT BELOW THIS LINE, UNLESS YOU FULLY UNDERSTAND THE IMPLICATIONS. 
    6565// ---------------------------------------------------------------------------- 
    66 // $Id: index.php 2005 2008-02-09 06:07:53Z PugFish $ 
     66// $Id: index.php 3366 2008-08-27 22:15:39Z Shadowhand $ 
    6767// 
    6868 
    6969// Define the front controller name and docroot 
    7070define('DOCROOT', getcwd().DIRECTORY_SEPARATOR); 
    71 define('KOHANA',  substr(__FILE__, strlen(DOCROOT))); 
     71define('KOHANA',  basename(__FILE__)); 
     72 
     73// If the front controller is a symlink, change to the real docroot 
     74is_link(KOHANA) and chdir(dirname(realpath(__FILE__))); 
    7275 
    7376// Define application and system paths 
     
    7982unset($kohana_application, $kohana_modules, $kohana_system); 
    8083 
    81 (is_dir(APPPATH) AND is_dir(APPPATH.'/config')) or die 
    82 ( 
    83         'Your <code>$kohana_application</code> directory does not exist. '. 
    84         'Set a valid <code>$kohana_application</code> in <tt>'.KOHANA.'</tt> and refresh the page.' 
    85 ); 
     84if ( ! IN_PRODUCTION) 
     85{ 
     86        // Check APPPATH 
     87        if ( ! (is_dir(APPPATH) AND is_file(APPPATH.'config/config'.EXT))) 
     88        { 
     89                die 
     90                ( 
     91                        '<div style="width:80%;margin:50px auto;text-align:center;">'. 
     92                                '<h3>Application Directory Not Found</h3>'. 
     93                                '<p>The <code>$kohana_application</code> directory does not exist.</p>'. 
     94                                '<p>Set <code>$kohana_application</code> in <tt>'.KOHANA.'</tt> to a valid directory and refresh the page.</p>'. 
     95                        '</div>' 
     96                ); 
     97        } 
    8698 
    87 (is_dir(SYSPATH) AND file_exists(SYSPATH.'/core/'.'Bootstrap'.EXT)) or die 
    88 ( 
    89         'Your <code>$kohana_system</code> directory does not exist. '. 
    90         'Set a valid <code>$kohana_system</code> in <tt>'.KOHANA.'</tt> and refresh the page.' 
    91 ); 
     99        // Check SYSPATH 
     100        if ( ! (is_dir(SYSPATH) AND is_file(SYSPATH.'bootstrap'.EXT))) 
     101        { 
     102                die 
     103                ( 
     104                        '<div style="width:80%;margin:50px auto;text-align:center;">'. 
     105                                '<h3>System Directory Not Found</h3>'. 
     106                                '<p>The <code>$kohana_system</code> directory does not exist.</p>'. 
     107                                '<p>Set <code>$kohana_system</code> in <tt>'.KOHANA.'</tt> to a valid directory and refresh the page.</p>'. 
     108                        '</div>' 
     109                ); 
     110        } 
     111} 
    92112 
    93 require SYSPATH.'core/Bootstrap'.EXT; 
     113// Initialize Kohana 
     114require SYSPATH.'bootstrap'.EXT;