Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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