@@ -24,27 +24,27 @@ discard block |
||
24 | 24 | |
25 | 25 | // IIS will populate server variables using one of these two ways |
26 | 26 | if ($isIIS) { |
27 | - if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { |
|
28 | - $url = ""; |
|
29 | - } elseif ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
30 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
31 | - $url = strtok($url, '?'); |
|
32 | - } else { |
|
33 | - $url = $_SERVER['REQUEST_URI']; |
|
34 | - if ($url[0] == '/') { |
|
35 | - $url = substr($url, 1); |
|
36 | - } |
|
37 | - $url = strtok($url, '?'); |
|
38 | - } |
|
27 | + if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { |
|
28 | + $url = ""; |
|
29 | + } elseif ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
30 | + $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
31 | + $url = strtok($url, '?'); |
|
32 | + } else { |
|
33 | + $url = $_SERVER['REQUEST_URI']; |
|
34 | + if ($url[0] == '/') { |
|
35 | + $url = substr($url, 1); |
|
36 | + } |
|
37 | + $url = strtok($url, '?'); |
|
38 | + } |
|
39 | 39 | |
40 | 40 | // Apache will populate the server variables this way |
41 | 41 | } else { |
42 | - if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
43 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
44 | - $url = strtok($url, '?'); |
|
45 | - } else { |
|
46 | - $url = ""; |
|
47 | - } |
|
42 | + if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
43 | + $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
44 | + $url = strtok($url, '?'); |
|
45 | + } else { |
|
46 | + $url = ""; |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $_GET['url'] = $_REQUEST['url'] = $url; |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | * Very quickly pass through references to files |
57 | 57 | */ |
58 | 58 | if ($url && file_exists($fileName)) { |
59 | - $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url; |
|
60 | - if (isset($_SERVER['QUERY_STRING'])) { |
|
61 | - $fileURL .= '?' . $_SERVER['QUERY_STRING']; |
|
62 | - } |
|
63 | - header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); |
|
64 | - header("Location: $fileURL"); |
|
65 | - die(); |
|
59 | + $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url; |
|
60 | + if (isset($_SERVER['QUERY_STRING'])) { |
|
61 | + $fileURL .= '?' . $_SERVER['QUERY_STRING']; |
|
62 | + } |
|
63 | + header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); |
|
64 | + header("Location: $fileURL"); |
|
65 | + die(); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | require_once 'framework/main.php'; |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | if ($isIIS) { |
27 | 27 | if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { |
28 | 28 | $url = ""; |
29 | - } elseif ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
30 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
29 | + } elseif ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen+1) == ($_SERVER['SCRIPT_NAME'].'/')) { |
|
30 | + $url = substr($_SERVER['REQUEST_URI'], $snLen+1); |
|
31 | 31 | $url = strtok($url, '?'); |
32 | 32 | } else { |
33 | 33 | $url = $_SERVER['REQUEST_URI']; |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | // Apache will populate the server variables this way |
41 | 41 | } else { |
42 | - if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { |
|
43 | - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); |
|
42 | + if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen+1) == ($_SERVER['SCRIPT_NAME'].'/')) { |
|
43 | + $url = substr($_SERVER['REQUEST_URI'], $snLen+1); |
|
44 | 44 | $url = strtok($url, '?'); |
45 | 45 | } else { |
46 | 46 | $url = ""; |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | |
50 | 50 | $_GET['url'] = $_REQUEST['url'] = $url; |
51 | 51 | |
52 | -$fileName = dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $url; |
|
52 | +$fileName = dirname($_SERVER['SCRIPT_FILENAME']).'/'.$url; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * This code is a very simple wrapper for sending files |
56 | 56 | * Very quickly pass through references to files |
57 | 57 | */ |
58 | 58 | if ($url && file_exists($fileName)) { |
59 | - $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $url; |
|
59 | + $fileURL = (dirname($_SERVER['SCRIPT_NAME']) == '/' ? '' : dirname($_SERVER['SCRIPT_NAME'])).'/'.$url; |
|
60 | 60 | if (isset($_SERVER['QUERY_STRING'])) { |
61 | - $fileURL .= '?' . $_SERVER['QUERY_STRING']; |
|
61 | + $fileURL .= '?'.$_SERVER['QUERY_STRING']; |
|
62 | 62 | } |
63 | - header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently'); |
|
63 | + header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently'); |
|
64 | 64 | header("Location: $fileURL"); |
65 | 65 | die(); |
66 | 66 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | ************************************************************************************/ |
11 | 11 | |
12 | 12 | if (!file_exists('framework') || !file_exists('framework/_config.php')) { |
13 | - include 'install-frameworkmissing.html'; |
|
13 | + include 'install-frameworkmissing.html'; |
|
14 | 14 | } else { |
15 | - include './framework/src/Dev/Install/install.php'; |
|
15 | + include './framework/src/Dev/Install/install.php'; |
|
16 | 16 | } |
@@ -2,28 +2,28 @@ |
||
2 | 2 | |
3 | 3 | class Page_Controller extends ContentController |
4 | 4 | { |
5 | - /** |
|
6 | - * An array of actions that can be accessed via a request. Each array element should be an action name, and the |
|
7 | - * permissions or conditions required to allow the user to access it. |
|
8 | - * |
|
9 | - * <code> |
|
10 | - * array ( |
|
11 | - * 'action', // anyone can access this action |
|
12 | - * 'action' => true, // same as above |
|
13 | - * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action |
|
14 | - * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true |
|
15 | - * ); |
|
16 | - * </code> |
|
17 | - * |
|
18 | - * @var array |
|
19 | - */ |
|
20 | - private static $allowed_actions = array( |
|
21 | - ); |
|
5 | + /** |
|
6 | + * An array of actions that can be accessed via a request. Each array element should be an action name, and the |
|
7 | + * permissions or conditions required to allow the user to access it. |
|
8 | + * |
|
9 | + * <code> |
|
10 | + * array ( |
|
11 | + * 'action', // anyone can access this action |
|
12 | + * 'action' => true, // same as above |
|
13 | + * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action |
|
14 | + * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true |
|
15 | + * ); |
|
16 | + * </code> |
|
17 | + * |
|
18 | + * @var array |
|
19 | + */ |
|
20 | + private static $allowed_actions = array( |
|
21 | + ); |
|
22 | 22 | |
23 | - public function init() |
|
24 | - { |
|
25 | - parent::init(); |
|
26 | - // You can include any CSS or JS required by your project here. |
|
27 | - // See: http://doc.silverstripe.org/framework/en/reference/requirements |
|
28 | - } |
|
23 | + public function init() |
|
24 | + { |
|
25 | + parent::init(); |
|
26 | + // You can include any CSS or JS required by your project here. |
|
27 | + // See: http://doc.silverstripe.org/framework/en/reference/requirements |
|
28 | + } |
|
29 | 29 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | class Page extends SiteTree |
6 | 6 | { |
7 | - private static $db = array( |
|
8 | - ); |
|
7 | + private static $db = array( |
|
8 | + ); |
|
9 | 9 | |
10 | - private static $has_one = array( |
|
11 | - ); |
|
10 | + private static $has_one = array( |
|
11 | + ); |
|
12 | 12 | } |