Merge branch '3.6' into 3

This commit is contained in:
Daniel Hensby 2017-05-08 16:20:04 +01:00
commit 02e3e102c1
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
7 changed files with 96 additions and 65 deletions

View File

@ -8,7 +8,7 @@ root = true
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

View File

@ -31,7 +31,9 @@ if($isIIS) {
$url = strtok($url, '?');
} else {
$url = $_SERVER['REQUEST_URI'];
if($url[0] == '/') $url = substr($url,1);
if ($url[0] == '/') {
$url = substr($url, 1);
}
$url = strtok($url, '?');
}
@ -63,4 +65,4 @@ if($url && file_exists($fileName)) {
die();
}
require_once('framework/main.php');
require_once 'framework/main.php';

View File

@ -9,5 +9,8 @@
************************************************************************************
************************************************************************************/
if (!file_exists('framework') || !file_exists('framework/_config.php')) include "install-frameworkmissing.html";
else include('./framework/dev/install/install.php');
if (!file_exists('framework') || !file_exists('framework/_config.php')) {
include 'install-frameworkmissing.html';
} else {
include './framework/dev/install/install.php';
}

View File

@ -6,7 +6,7 @@ $project = 'mysite';
global $database;
$database = '';
require_once('conf/ConfigureFromEnv.php');
require_once 'conf/ConfigureFromEnv.php';
// Set the site locale
i18n::set_locale('en_US');

View File

@ -1,37 +1,10 @@
<?php
class Page extends SiteTree {
class Page extends SiteTree
{
private static $db = array(
);
private static $has_one = array(
);
}
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
}
}

View File

@ -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
phpcs.xml.dist Normal file
View File

@ -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>