Compare commits

..

No commits in common. "050f94ae88f35250cd7adc4b221d6f8a2028570e" and "599bb7bd6db21eef4b09704a69ec995b55a35874" have entirely different histories.

26 changed files with 14 additions and 4430 deletions

View file

@ -1,2 +0,0 @@
[date]
date.timezone="Europe/Zurich"

View file

@ -8,10 +8,4 @@ docker-compose*
*/obj */obj
README.md README.md
LICENSE LICENSE
.vscode .vscode
# SilverStripe auto-generated content
Website/silverstripe-cache/
Website/vendor/
Website/resources/
Website/public/resources/

View file

@ -1,14 +0,0 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"felixfbecker.php-pack",
"neilbrayfield.php-docblocker"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
]
}

33
.vscode/tasks.json vendored
View file

@ -1,33 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Lint Website",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/Website"
},
"command": "composer",
"args": [
"lint"
],
"problemMatcher": {
"owner": "phpcs",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^\"(.*)\",(\\d+),(\\d+),(.*),\"(.*)\",(.*),(\\d+),(\\d+)",
"file": 1,
"line": 2,
"column": 3,
"message": 5,
"code": 6
}
],
"severity": "warning"
}
}
]
}

View file

@ -1,43 +1,19 @@
FROM php:7.1.27-apache FROM php:7.1.27-apache
RUN chown -R www-data:www-data /var/www
RUN apt update -y RUN apt -y update
RUN apt install --no-install-recommends -y \ RUN apt install -y --no-install-recommends \
libicu-dev \ libicu-dev \
libmagickwand-dev \ libmagickwand-dev
libtidy-dev \
libzip-dev \
mysql-client \
sudo \
unzip \
zip
RUN a2enmod rewrite
RUN docker-php-ext-configure intl RUN docker-php-ext-configure intl
RUN docker-php-ext-configure zip --with-libzip RUN docker-php-ext-install intl
RUN docker-php-ext-install \
gd \
intl \
pdo \
pdo_mysql \
tidy \
zip
RUN pecl install \ RUN pecl install \
xdebug \ xdebug \
imagick imagick
RUN docker-php-ext-enable \ RUN docker-php-ext-enable \
xdebug \ xdebug \
imagick imagick
RUN chown -R www-data:www-data /var/www/html
ADD https://getcomposer.org/installer composer-setup.php COPY .docker/xdebug.ini $PHP_INI_DIR/conf.d/xdebug.ini
RUN php composer-setup.php COPY ./src/ /var/www/html/
RUN mv composer.phar /usr/local/bin/composer
COPY --chown=www-data:www-data ./Website/composer.* ./
RUN sudo -u www-data mkdir public
RUN sudo -u www-data composer install
COPY .docker/xdebug.ini $PHP_INI_DIR/conf.d/
COPY .docker/date.ini $PHP_INI_DIR/conf.d/
COPY --chown=www-data:www-data ./Website/ ./
RUN sudo -u www-data composer vendor-expose

6
Website/.gitignore vendored
View file

@ -1,6 +0,0 @@
/silverstripe-cache/
/.env
/vendor/
/themes/simple/
/resources/
/public/resources/

View file

@ -1,2 +0,0 @@
RewriteEngine On
RewriteRule ^(.*)$ public/$1

View file

@ -1,3 +0,0 @@
<FilesMatch "\.(php|php3|php4|php5|phtml|inc)$">
Deny from all
</FilesMatch>

View file

@ -1,9 +0,0 @@
<?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);

View file

@ -1,5 +0,0 @@
---
Name: m@nuth
---
SilverStripe\Core\Manifest\ModuleManifest:
project: app

View file

@ -1,8 +0,0 @@
---
Name: mytheme
---
SilverStripe\View\SSViewer:
themes:
- '$public'
- 'simple'
- '$default'

View file

@ -1,15 +0,0 @@
<?php
namespace
{
use SilverStripe\CMS\Model\SiteTree;
class Page extends SiteTree
{
private static $db = [];
private static $has_one = [];
}
}
?>

View file

@ -1,33 +0,0 @@
<?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.
*
* ```php
* [
* '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 = [];
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/
}
}
}

View file

@ -1,39 +0,0 @@
{
"name": "silverstripe/installer",
"type": "silverstripe-recipe",
"description": "The SilverStripe Framework Installer",
"require": {
"php": ">=5.6.0",
"silverstripe/recipe-plugin": "^1.2",
"silverstripe/recipe-cms": "4.3.3@stable",
"silverstripe-themes/simple": "~3.2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "*"
},
"scripts": {
"lint": "phpcs --report=csv ."
},
"extra": {
"project-files-installed": [
"app/.htaccess",
"app/_config.php",
"app/_config/mysite.yml",
"app/src/Page.php",
"app/src/PageController.php"
],
"public-files-installed": [
".htaccess",
"index.php",
"install-frameworkmissing.html",
"install.php",
"web.config"
]
},
"config": {
"process-timeout": 600
},
"prefer-stable": true,
"minimum-stability": "dev"
}

4021
Website/composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,25 +0,0 @@
<?xml version="1.0"?>
<ruleset name="SS3">
<description>Coding standard for SilverStripe 4.x</description>
<!-- Don't sniff third party libraries -->
<exclude-pattern>*/themes/simple/*</exclude-pattern>
<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>

View file

@ -1,54 +0,0 @@
### SILVERSTRIPE START ###
# Deny access to templates (but allow from localhost)
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>
# Deny access to IIS configuration
<Files web.config>
Order deny,allow
Deny from all
</Files>
# Deny access to YAML configuration files which might include sensitive information
<Files ~ "\.ya?ml$">
Order allow,deny
Deny from all
</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.
# Pass through the original path as a query parameter, and retain the existing parameters.
# Try finding framework in the vendor folder first
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php
</IfModule>
### SILVERSTRIPE END ###

View file

@ -1,4 +0,0 @@
/**/*
!.gitignore
!.htaccess
!web.config

View file

@ -1,35 +0,0 @@
#
# 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]
# Block invalid 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)$
RewriteRule .* - [F]
# Non existant files passed to requesthandler
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* ../index.php [QSA]
</IfModule>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,27 +0,0 @@
<?php
use SilverStripe\Control\HTTPApplication;
use SilverStripe\Control\HTTPRequestBuilder;
use SilverStripe\Core\CoreKernel;
use SilverStripe\Core\Startup\ErrorControlChainMiddleware;
// Find autoload.php
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
require __DIR__ . '/../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
} else {
header('HTTP/1.1 500 Internal Server Error');
echo "autoload.php not found";
exit(1);
}
// Build request and detect flush
$request = HTTPRequestBuilder::createFromEnvironment();
// Default application
$kernel = new CoreKernel(BASE_PATH);
$app = new HTTPApplication($kernel);
$app->addMiddleware(new ErrorControlChainMiddleware($app));
$response = $app->handle($request);
$response->output();

View file

@ -1,34 +0,0 @@
<html>
<head>
<title>The SilverStripe Framework is missing</title>
</head>
<body>
<div id="BgContainer">
<div id="Container">
<div id="Header">
<h1>SilverStripe CMS Installation</h1>
</div>
<div id="Navigation">&nbsp;</div>
<div class="clear"><!-- --></div>
<div id="Layout">
<div class="typography">
<p><strong>The SilverStripe Framework is missing</strong> - To run the installer, at least the <strong>framework</strong> module is required.</p>
<p>If you downloaded a pre-packaged zip or tar.gz, something might have gone wrong with the packaging
process. Please try re-downloading, or try an older version.</p>
<p>If you downloaded this from <a href="https://github.com/silverstripe">GitHub</a>, you need to install the <strong>framework</strong> module. You can do this manually, or by running the tools/new-project script from the command line.</p>
</div>
</div>
<div class="clear"><!-- --></div>
</div>
<div id="Footer">
<div class="footerTop"><!-- --></div>
<p><a href="http://silverstripe.org">SilverStripe Open Source CMS</a> | Copyright &copy; 2008-2011 SilverStripe Limited</p>
</div>
</div>
</body>
</html>

View file

@ -1,18 +0,0 @@
<?php
/************************************************************************************
************************************************************************************
** **
** If you can read this text in your browser then you don't have PHP installed. **
** Please install PHP 5.6.0 or higher. **
** **
************************************************************************************
************************************************************************************/
if (file_exists(__DIR__ . '/vendor/silverstripe/framework/src/Dev/Install/install.php')) {
include __DIR__ . '/vendor/silverstripe/framework/src/Dev/Install/install.php';
} elseif (file_exists(__DIR__ . '/../vendor/silverstripe/framework/src/Dev/Install/install.php')) {
include __DIR__ . '/../vendor/silverstripe/framework/src/Dev/Install/install.php';
} else {
include 'install-frameworkmissing.html';
}

View file

@ -12,11 +12,10 @@ services:
ports: ports:
- 8000:80 - 8000:80
db: db:
image: mysql:5 image: mysql:latest
networks: networks:
- nuth - nuth
ports: ports:
- 13306:3306 - 13306:3306
environment: environment:
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: SilverStripe

View file

@ -2,8 +2,7 @@
cd $(dirname $0) cd $(dirname $0)
cd .. cd ..
tempDir=$(mktemp -d) tempDir=$(mktemp -d)
sourceDir="./Website" find . -name "*" -and -not -name "." -and -not -path "./src/*" -and -not -path "./src" -exec rm -rf {} +
find . -name "*" -and -not -name "." -and -not -path "$sourceDir/*" -and -not -path $sourceDir -exec rm -rf {} +
rsync -a --delete ./src/ $tempDir rsync -a --delete ./src/ $tempDir
rsync -a --delete $tempDir/ . rsync -a --delete $tempDir/ .
rm -rf $tempDir rm -rf $tempDir

3
src/index.php Normal file
View file

@ -0,0 +1,3 @@
<?php
echo "This is a test";
?>