Merge pull request #177 from nfauchelle/psr-2-adjustments

Update the PHP files to PSR-2 spec
This commit is contained in:
Damian Mooyman 2017-05-15 09:15:09 +12:00 committed by GitHub
commit d9f28b2017
4 changed files with 62 additions and 55 deletions

View File

@ -26,14 +26,18 @@ $isIIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false);
if ($isIIS) { if ($isIIS) {
if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) { if ($_SERVER['REQUEST_URI'] == $_SERVER['SCRIPT_NAME']) {
$url = ""; $url = "";
} else if($ruLen > $snLen && substr($_SERVER['REQUEST_URI'],0,$snLen+1) == ($_SERVER['SCRIPT_NAME'] . '/')) { } else {
if ($ruLen > $snLen && substr($_SERVER['REQUEST_URI'], 0, $snLen + 1) == ($_SERVER['SCRIPT_NAME'] . '/')) {
$url = substr($_SERVER['REQUEST_URI'], $snLen + 1); $url = substr($_SERVER['REQUEST_URI'], $snLen + 1);
$url = strtok($url, '?'); $url = strtok($url, '?');
} else { } else {
$url = $_SERVER['REQUEST_URI']; $url = $_SERVER['REQUEST_URI'];
if($url[0] == '/') $url = substr($url,1); if ($url[0] == '/') {
$url = substr($url, 1);
}
$url = strtok($url, '?'); $url = strtok($url, '?');
} }
}
// Apache will populate the server variables this way // Apache will populate the server variables this way
} else { } else {

View File

@ -5,8 +5,10 @@ use SilverStripe\CMS\Model\SiteTree;
class Page extends SiteTree class Page extends SiteTree
{ {
private static $db = array( private static $db = array(
); );
private static $has_one = array( private static $has_one = array(
); );
} }

View File

@ -20,6 +20,7 @@ class PageController extends ContentController
* @var array * @var array
*/ */
private static $allowed_actions = array( private static $allowed_actions = array(
); );
protected function init() protected function init()