Skip to content

Commit

Permalink
Merge branch '3'
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jun 27, 2017
2 parents c9c9cf7 + 61bf3af commit 69441ab
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 16 deletions.
20 changes: 9 additions & 11 deletions index.php
Expand Up @@ -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. **
** **
************************************************************************************
************************************************************************************/
Expand All @@ -26,17 +26,15 @@
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
Expand Down Expand Up @@ -67,4 +65,4 @@
die();
}

require_once('framework/main.php');
require_once 'framework/main.php';
6 changes: 3 additions & 3 deletions install.php
Expand Up @@ -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';
}
2 changes: 0 additions & 2 deletions mysite/code/Page.php
Expand Up @@ -5,10 +5,8 @@
class Page extends SiteTree
{
private static $db = array(

);

private static $has_one = array(

);
}
29 changes: 29 additions & 0 deletions mysite/code/Page_Controller.php
@@ -0,0 +1,29 @@
<?php

class Page_Controller extends ContentController
{
/**
* An array of actions that can be accessed via a request. Each array element should be an action name, and the
* permissions or conditions required to allow the user to access it.
*
* <code>
* 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
* );
* </code>
*
* @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
}
}
24 changes: 24 additions & 0 deletions phpcs.xml.dist
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset name="SS3">
<description>Coding standard for SilverStripe 3.x</description>

<!-- Don't sniff third party libraries -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/thirdparty/*</exclude-pattern>

<!-- Show progress and output sniff names on violation, and add colours -->
<arg value="sp"/>
<arg name="colors"/>

<!-- Use PSR-2 as a base standard -->
<rule ref="PSR2">
<!-- Allow classes to not declare a namespace -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>

<!-- Allow underscores in class names -->
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>

<!-- Allow non camel cased method names -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>
</ruleset>

0 comments on commit 69441ab

Please sign in to comment.