From 2d04b844b78d4b4fbbff054e58fbf1b06d965060 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 11 Jul 2017 16:04:01 +1200 Subject: [PATCH] API Convert installer to recipe --- .cow.json | 3 ++ .htaccess | 59 ---------------------------------- composer.json | 26 +++++++-------- mysite/.htaccess | 3 -- mysite/_config.php | 1 - mysite/_config/config.yml | 10 ------ mysite/_config/theme.yml | 7 ++++ mysite/code/Page.php | 12 ------- mysite/code/PageController.php | 32 ------------------ web.config | 20 ------------ 10 files changed, 23 insertions(+), 150 deletions(-) delete mode 100644 .htaccess delete mode 100644 mysite/.htaccess delete mode 100644 mysite/_config.php delete mode 100644 mysite/_config/config.yml create mode 100644 mysite/_config/theme.yml delete mode 100755 mysite/code/Page.php delete mode 100644 mysite/code/PageController.php delete mode 100644 web.config diff --git a/.cow.json b/.cow.json index 1c1ac9f..50d7641 100644 --- a/.cow.json +++ b/.cow.json @@ -10,5 +10,8 @@ "tests": [ "vendor/bin/phpunit framework/tests/php", "vendor/bin/phpunit cms/tests" + ], + "exclude": [ + "silverstripe/recipe-plugin" ] } diff --git a/.htaccess b/.htaccess deleted file mode 100644 index b2a4f3f..0000000 --- a/.htaccess +++ /dev/null @@ -1,59 +0,0 @@ -### SILVERSTRIPE START ### - -# Deny access to templates (but allow from localhost) - - Order deny,allow - Deny from all - Allow from 127.0.0.1 - - -# Deny access to IIS configuration - - Order deny,allow - Deny from all - - -# Deny access to YAML configuration files which might include sensitive information - - Order allow,deny - Deny from all - - -# Route errors to static pages automatically generated by SilverStripe -ErrorDocument 404 /assets/error-404.html -ErrorDocument 500 /assets/error-500.html - - - - # Turn off index.php handling requests to the homepage fixes issue in apache >=2.4 - - DirectoryIndex disabled - DirectorySlash Off - - - 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 ^\.env - [F,L,NC] - RewriteRule ^vendor(/|$) - [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. - RewriteCond %{REQUEST_URI} ^(.*)$ - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule .* framework/main.php?url=%1 [QSA] - - # If framework isn't in a subdirectory, rewrite to installer - RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$ - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule . %1/install.php? [R,L] - - -### SILVERSTRIPE END ### diff --git a/composer.json b/composer.json index 79d79cb..d4f3bc9 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,26 @@ { "name": "silverstripe/installer", + "type": "silverstripe-recipe", "description": "The SilverStripe Framework Installer", "require": { "php": ">=5.6.0", - "silverstripe/admin": "1.0.x-dev", - "silverstripe/asset-admin": "1.0.x-dev", - "silverstripe/assets": "1.0.x-dev", - "silverstripe/campaign-admin": "1.0.x-dev", - "silverstripe/cms": "4.0.x-dev", - "silverstripe/config": "1.0.x-dev", - "silverstripe/errorpage": "1.0.x-dev", - "silverstripe/framework": "4.0.x-dev", - "silverstripe/graphql": "0.2.x-dev", - "silverstripe/reports": "4.0.x-dev", - "silverstripe/siteconfig": "4.0.x-dev", - "silverstripe/versioned": "1.0.x-dev", + "silverstripe/recipe-plugin": "^0.1", + "silverstripe/recipe-cms": "1.0.x-dev", "silverstripe-themes/simple": "~3.2.0" }, "require-dev": { "phpunit/PHPUnit": "^5.7" }, "extra": { + "project-files": [ + "assets/*", + "mysite/_config/*", + "index.php", + "install.php", + ".env.example", + "favicon.ico", + "install-frameworkmissing.html" + ], "branch-alias": { "4.x-dev": "4.0.x-dev", "dev-master": "5.x-dev" @@ -31,4 +31,4 @@ }, "prefer-stable": true, "minimum-stability": "dev" -} \ No newline at end of file +} diff --git a/mysite/.htaccess b/mysite/.htaccess deleted file mode 100644 index fad44cc..0000000 --- a/mysite/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ - - Deny from all - \ No newline at end of file diff --git a/mysite/_config.php b/mysite/_config.php deleted file mode 100644 index b3d9bbc..0000000 --- a/mysite/_config.php +++ /dev/null @@ -1 +0,0 @@ - - * 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 - * ); - * - * - * @var array - */ - private static $allowed_actions = array( - - ); - - 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/ - } -} diff --git a/web.config b/web.config deleted file mode 100644 index aa7f03b..0000000 --- a/web.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - -