Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed Nov 2, 2020
1 parent 0b4f59a commit 22b1186
Show file tree
Hide file tree
Showing 7,588 changed files with 949,499 additions and 6 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
47 changes: 47 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
### SILVERSTRIPE START ###

# Deny access to templates (but allow from localhost)
<Files *.ss>
Require ip 127.0.0.1
</Files>

# Deny access to IIS configuration
<Files web.config>
Require all denied
</Files>

# Deny access to YAML configuration files which might include sensitive information
<Files ~ "\.ya?ml$">
Require all denied
</Files>

# Route errors to static pages automatically generated by SilverStripe
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_rewrite.c>

# Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
<IfModule mod_dir.c>
DirectoryIndex disabled
DirectorySlash On
</IfModule>

SetEnv HTTP_MOD_REWRITE On
RewriteEngine On

# Enable HTTP Basic authentication workaround for PHP running in CGI mode
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Deny access to potentially sensitive files and folders
RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule ^\.env - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]
RewriteRule (error|silverstripe|debug)\.log - [F,L,NC]

# Process through SilverStripe if no file with the requested name exists.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php
</IfModule>
### SILVERSTRIPE END ###
3 changes: 3 additions & 0 deletions app/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<FilesMatch "\.(php|php3|php4|php5|phtml|inc)$">
Require all denied
</FilesMatch>
9 changes: 9 additions & 0 deletions app/_config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

use SilverStripe\Security\PasswordValidator;
use SilverStripe\Security\Member;

// remove PasswordValidator for SilverStripe 5.0
$validator = PasswordValidator::create();
// Settings are registered via Injector configuration - see passwords.yml in framework
Member::set_password_validator($validator);
8 changes: 8 additions & 0 deletions app/_config/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
Name: myproject-database
---
SilverStripe\ORM\Connect\MySQLDatabase:
connection_charset: utf8mb4
connection_collation: utf8mb4_unicode_ci
charset: utf8mb4
collation: utf8mb4_unicode_ci
9 changes: 9 additions & 0 deletions app/_config/mimevalidator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
Name: app-mimeuploadvalidator
After: '#mimeuploadvalidator'
Only:
moduleexists: 'silverstripe/mimevalidator'
---
SilverStripe\Core\Injector\Injector:
SilverStripe\Assets\Upload_Validator:
class: SilverStripe\MimeValidator\MimeUploadValidator
5 changes: 5 additions & 0 deletions app/_config/mysite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
project: app
13 changes: 13 additions & 0 deletions app/src/Page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace {

use SilverStripe\CMS\Model\SiteTree;

class Page extends SiteTree
{
private static $db = [];

private static $has_one = [];
}
}
33 changes: 33 additions & 0 deletions app/src/PageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace {

use SilverStripe\CMS\Controllers\ContentController;

class PageController 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>
* [
* '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 = [];

protected function init()
{
parent::init();
// You can include any CSS or JS required by your project here.
// See: https://docs.silverstripe.org/en/developer_guides/templates/requirements/
}
}
}
35 changes: 35 additions & 0 deletions assets/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# Whitelist appropriate assets files.
# This file is automatically generated via File.allowed_extensions configuration
# See AssetAdapter::renderTemplate() for reference.
#

# We disable PHP via several methods
# Replace the handler with the default plaintext handler
AddHandler default-handler php phtml php3 php4 php5 inc

<IfModule mod_php5.c>
# Turn the PHP engine off
php_flag engine off
</IfModule>

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine On

# Allow error pages
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule error[^\\/]*\.html$ - [L]

# Allow specific file extensions
RewriteCond %{REQUEST_URI} !^[^.]*[^\/]*\.(?i:css|js|ace|arc|arj|asf|au|avi|bmp|bz2|cab|cda|csv|dmg|doc|docx|dotx|flv|gif|gpx|gz|hqx|ico|jpeg|jpg|kml|m4a|m4v|mid|midi|mkv|mov|mp3|mp4|mpa|mpeg|mpg|ogg|ogv|pages|pcx|pdf|png|pps|ppt|pptx|potx|ra|ram|rm|rtf|sit|sitx|tar|tgz|tif|tiff|txt|wav|webm|wma|wmv|xls|xlsx|xltx|zip|zipx|graphql)$
RewriteRule .* - [F]

# Non existant files passed to requesthandler
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* ../index.php [QSA]
</IfModule>
2 changes: 2 additions & 0 deletions assets/.protected/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Require all denied
RewriteRule .* - [F]
26 changes: 26 additions & 0 deletions assets/error-404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="http://versioned.test/"><!--[if lte IE 6]></base><![endif]-->

<title>Page not found</title>
<meta name="generator" content="SilverStripe - https://www.silverstripe.org" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<link rel="stylesheet" type="text/css" href="/resources/silverstripe/framework/client/styles/debug.css?m=1604189410" />
</head>
<body>
<div class="info">
<h1>Page not found</h1>
</div>

<div class="options">

<p>Sorry, it seems you were trying to access a page that doesn't exist.</p><p>Please check the spelling of the URL you were trying to access and try again.</p>


</div>
</body>
</html>
26 changes: 26 additions & 0 deletions assets/error-500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="http://versioned.test/"><!--[if lte IE 6]></base><![endif]-->

<title>Server error</title>
<meta name="generator" content="SilverStripe - https://www.silverstripe.org" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<link rel="stylesheet" type="text/css" href="/resources/silverstripe/framework/client/styles/debug.css?m=1604189410" />
</head>
<body>
<div class="info">
<h1>Server error</h1>
</div>

<div class="options">

<p>Sorry, there was a problem with handling your request.</p>


</div>
</body>
</html>
32 changes: 28 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,48 @@
"require": {
"silverstripe/framework": "^4.7",
"silverstripe/vendor-plugin": "^1",
"symfony/cache": "^3.4"
"symfony/cache": "^3.4",
"silverstripe/recipe-cms": "4.x-dev",
"sminnee/phpunit-mock-objects": "^3",
"silverstripe/admin": "dev-pulls/1/schemageddon as 1.x-dev",
"silverstripe/asset-admin": "dev-pulls/1/schemageddon as 1.x-dev",
"silverstripe/versioned-admin": "dev-pulls/1/schemageddon as 1.x-dev",
"silverstripe/cms": "dev-pulls/4/schemageddon as 4.x-dev",
"silverstripe/graphql": "4.x-dev as 3.x-dev"
},
"require-dev": {
"sminnee/phpunit": "^5.7",
"silverstripe/graphql": "3.x-dev || 4.x-dev",
"squizlabs/php_codesniffer": "^3"
},
"autoload": {
"psr-4": {
"SilverStripe\\Versioned\\": "src/",
"SilverStripe\\Versioned\\Tests\\": "tests/php/"
},
"classmap": ["src/GraphQL/_legacy"]
"classmap": [
"src/GraphQL/_legacy"
]
},
"scripts": {
"lint": "vendor/bin/phpcs src/ tests/php/",
"lint-clean": "vendor/bin/phpcbf src/ tests/php/"
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"extra": {
"project-files-installed": [
"app/.htaccess",
"app/_config.php",
"app/_config/database.yml",
"app/_config/mimevalidator.yml",
"app/_config/mysite.yml",
"app/src/Page.php",
"app/src/PageController.php"
],
"public-files-installed": [
".htaccess",
"index.php",
"web.config"
]
}
}
Loading

0 comments on commit 22b1186

Please sign in to comment.