Projekt

Obecné

Profil

Stáhnout (2.62 KB) Statistiky
| Větev: | Tag: | Revize:
1
<?php
2
/* SVN FILE: $Id: index.php 4409 2007-02-02 13:20:59Z phpnut $ */
3
/**
4
 * Requests collector.
5
 *
6
 *  This file collects requests if:
7
 *	- no mod_rewrite is avilable or .htaccess files are not supported
8
 *	-/public is not set as a web root.
9
 *
10
 * PHP versions 4 and 5
11
 *
12
 * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
13
 * Copyright 2005-2007, Cake Software Foundation, Inc.
14
 *								1785 E. Sahara Avenue, Suite 490-204
15
 *								Las Vegas, Nevada 89104
16
 *
17
 * Licensed under The MIT License
18
 * Redistributions of files must retain the above copyright notice.
19
 *
20
 * @filesource
21
 * @copyright		Copyright 2005-2007, Cake Software Foundation, Inc.
22
 * @link				http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
23
 * @package			cake
24
 * @since			CakePHP(tm) v 0.2.9
25
 * @version			$Revision: 4409 $
26
 * @modifiedby		$LastChangedBy: phpnut $
27
 * @lastmodified	$Date: 2007-02-02 07:20:59 -0600 (Fri, 02 Feb 2007) $
28
 * @license			http://www.opensource.org/licenses/mit-license.php The MIT License
29
 */
30
/**
31
 *  Get Cake's root directory
32
 */
33
	define('APP_DIR', 'app');
34
	define('DS', DIRECTORY_SEPARATOR);
35
	define('ROOT', dirname(__FILE__));
36
	define('WEBROOT_DIR', 'webroot');
37
	define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
38
/**
39
 * This only needs to be changed if the cake installed libs are located
40
 * outside of the distributed directory structure.
41
 */
42
	if (!defined('CAKE_CORE_INCLUDE_PATH')) {
43
		//define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
44
		define('CAKE_CORE_INCLUDE_PATH', ROOT);
45
	}
46
	if (function_exists('ini_set')) {
47
		ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
48
		define('APP_PATH', null);
49
		define('CORE_PATH', null);
50
	} else {
51
		define('APP_PATH', ROOT . DS . APP_DIR . DS);
52
		define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
53
	}
54
	require CORE_PATH . 'cake' . DS . 'basics.php';
55
	require APP_PATH . 'config' . DS . 'core.php';
56
	require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
57
	$bootstrap=true;
58
	$uri      =setUri();
59
/**
60
 * As mod_rewrite (or .htaccess files) is not working, we need to take care
61
 * of what would normally be rewritten, i.e. the static files in app/webroot/
62
 */
63
	if ($uri === '/' || $uri === '/index.php') {
64
		$_GET['url'] = '/';
65
		require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
66
	} else {
67
		$elements=explode('/index.php', $uri);
68

    
69
		if (!empty($elements[1])) {
70
			$path = $elements[1];
71
		} else {
72
			$path = '/';
73
		}
74
		$_GET['url']=$path;
75
		require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
76
	}
(3-3/3)