diff --git a/index.php b/index.php index e922363..124b7b3 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ ************************************************************************************ ** ** ** If you can read this text in your browser then you don't have PHP installed. ** - ** Please install PHP 5.5.0 or higher. ** + ** Please install PHP 5.6.0 or higher. ** ** ** ************************************************************************************ ************************************************************************************/ @@ -26,17 +26,15 @@ $isIIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false); if ($isIIS) { if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { $url = ""; + } elseif ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { + $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); + $url = strtok($url, '?'); } else { - if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) { - $url = substr($_SERVER['REQUEST_URI'], $snLen + 1); - $url = strtok($url, '?'); - } else { - $url = $_SERVER['REQUEST_URI']; - if ($url[0] == '/') { - $url = substr($url, 1); - } - $url = strtok($url, '?'); + $url = $_SERVER['REQUEST_URI']; + if ($url[0] == '/') { + $url = substr($url, 1); } + $url = strtok($url, '?'); } // Apache will populate the server variables this way @@ -67,4 +65,4 @@ if ($url && file_exists($fileName)) { die(); } -require_once('framework/main.php'); +require_once 'framework/main.php'; diff --git a/install.php b/install.php index 269842a..5f3d533 100644 --- a/install.php +++ b/install.php @@ -4,13 +4,13 @@ ************************************************************************************ ** ** ** If you can read this text in your browser then you don't have PHP installed. ** - ** Please install PHP 5.5.0 or higher. ** + ** Please install PHP 5.6.0 or higher. ** ** ** ************************************************************************************ ************************************************************************************/ if (!file_exists('framework') || !file_exists('framework/_config.php')) { - include "install-frameworkmissing.html"; + include 'install-frameworkmissing.html'; } else { - include('./framework/src/Dev/Install/install.php'); + include './framework/src/Dev/Install/install.php'; } diff --git a/mysite/code/Page.php b/mysite/code/Page.php index df4f8fe..b83000d 100755 --- a/mysite/code/Page.php +++ b/mysite/code/Page.php @@ -5,10 +5,8 @@ use SilverStripe\CMS\Model\SiteTree; class Page extends SiteTree { private static $db = array( - ); private static $has_one = array( - ); } diff --git a/mysite/code/Page_Controller.php b/mysite/code/Page_Controller.php new file mode 100644 index 0000000..f661c42 --- /dev/null +++ b/mysite/code/Page_Controller.php @@ -0,0 +1,29 @@ + + * array ( + * 'action', // anyone can access this action + * 'action' => true, // same as above + * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action + * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true + * ); + * + * + * @var array + */ + private static $allowed_actions = array( + ); + + public function init() + { + parent::init(); + // You can include any CSS or JS required by your project here. + // See: http://doc.silverstripe.org/framework/en/reference/requirements + } +} diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..38151e4 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,24 @@ + + + Coding standard for SilverStripe 3.x + + + */vendor/* + */thirdparty/* + + + + + + + + + + + + + + + + +