Skip to content
Newer
Older
100644 88 lines (80 sloc) 2.4 KB
e1f48bf @phpnut going thru trunk and cleaning up the file headers so API docs can be …
phpnut authored Jul 4, 2005
1 <?php
1dce095 @phpnut merging changes from sandboxes
phpnut authored Sep 17, 2005
2 /* SVN FILE: $Id$ */
cd86555 @phpnut moving cake to a sub directory
phpnut authored May 15, 2005
3
4 /**
fbf4d9e @phpnut merging code from sandboxes since [430]
phpnut authored Aug 21, 2005
5 * Short description for file.
6 *
4234bc9 I've added some fixes and new methods, hope this gets to be in the to…
pies authored May 29, 2005
7 * This file collects requests if:
8 * - no mod_rewrite is avilable or .htaccess files are not supported
9 * - /public is not set as a web root.
fbf4d9e @phpnut merging code from sandboxes since [430]
phpnut authored Aug 21, 2005
10 *
11 * PHP versions 4 and 5
12 *
13 * CakePHP : Rapid Development Framework <http://www.cakephp.org/>
14 * Copyright (c) 2005, CakePHP Authors/Developers
15 *
16 * Author(s): Michal Tatarynowicz aka Pies <tatarynowicz@gmail.com>
17 * Larry E. Masters aka PhpNut <nut@phpnut.com>
18 * Kamil Dzielinski aka Brego <brego.dk@gmail.com>
19 *
20 * Licensed under The MIT License
21 * Redistributions of files must retain the above copyright notice.
22 *
4a87a75 - Two standard controllers -- PageController and TestsController
pies authored May 22, 2005
23 * @filesource
fbf4d9e @phpnut merging code from sandboxes since [430]
phpnut authored Aug 21, 2005
24 * @author CakePHP Authors/Developers
25 * @copyright Copyright (c) 2005, CakePHP Authors/Developers
26 * @link https://trac.cakephp.org/wiki/Authors Authors/Developers
27 * @package cake
28 * @since CakePHP v 0.2.9
29 * @version $Revision$
30 * @modifiedby $LastChangedBy$
4a87a75 - Two standard controllers -- PageController and TestsController
pies authored May 22, 2005
31 * @lastmodified $Date$
fbf4d9e @phpnut merging code from sandboxes since [430]
phpnut authored Aug 21, 2005
32 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
4a87a75 - Two standard controllers -- PageController and TestsController
pies authored May 22, 2005
33 */
4234bc9 I've added some fixes and new methods, hope this gets to be in the to…
pies authored May 29, 2005
34
4a87a75 - Two standard controllers -- PageController and TestsController
pies authored May 22, 2005
35 /**
4234bc9 I've added some fixes and new methods, hope this gets to be in the to…
pies authored May 29, 2005
36 * Get Cake's root directory
37 */
4a87a75 - Two standard controllers -- PageController and TestsController
pies authored May 22, 2005
38 define ('DS', DIRECTORY_SEPARATOR);
39 define ('ROOT', dirname(__FILE__).DS);
cd86555 @phpnut moving cake to a sub directory
phpnut authored May 15, 2005
40
41 /**
4234bc9 I've added some fixes and new methods, hope this gets to be in the to…
pies authored May 29, 2005
42 * We need to redefine some constants and variables, so that Cake knows it is
43 * working without mod_rewrite.
0a4a5e9 writing some docs, starting low...
brego authored May 17, 2005
44 */
3f10d74 - Cake didn't work without mod_rewrite, fixed (/index.php, /libs/rout…
pies authored Jun 5, 2005
45 define ('BASE_URL', $_SERVER['SCRIPT_NAME'].'?url=');
cd86555 @phpnut moving cake to a sub directory
phpnut authored May 15, 2005
46
3f10d74 - Cake didn't work without mod_rewrite, fixed (/index.php, /libs/rout…
pies authored Jun 5, 2005
47 /**
48 * As mod_rewrite (or .htaccess files) is not working, we need to take care
49 * of what would normally be rewrited, i.e. the static files in /public
50 */
6460f6e @phpnut Merging changes from revisions [337] [338] [339] [340] [341]
phpnut authored Jul 10, 2005
51 if (empty($_GET['url']) || ($_GET['url'] == '/'))
52 {
53 require (ROOT.'public/index.php');
54 }
55 else
56 {
57 $elements = explode('/index.php?url=', $_SERVER['REQUEST_URI']);
58 $base = $elements[0].'/public';
59 $path = $elements[1];
60
61 $filename = ROOT.'public'.str_replace('/', DS, $path);
62 $url = $base.$path;
4089572 @phpnut testing new server and maillist 4th
phpnut authored Jul 2, 2005
63
6460f6e @phpnut Merging changes from revisions [337] [338] [339] [340] [341]
phpnut authored Jul 10, 2005
64 if (file_exists($filename))
65 {
66 if (preg_match('/^.*\.([a-z]+)$/i', $filename, $ext))
67 {
68 switch ($ext[1])
69 {
70 case 'jpg':
71 case 'jpeg':
72 header('Content-type: image/jpeg');
73 break;
74
75 case 'css':
76 header('Content-type: text/css');
77 }
78 }
79
80 print (file_get_contents($filename));
81 die();
82 }
83 else
84 {
85 require (ROOT.'public/index.php');
86 }
87 }
b2ba766 @phpnut fixing my local working copy
phpnut authored May 21, 2005
88 ?>
Something went wrong with that request. Please try again.