Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Mar 15, 2024
1 parent 80c2dc5 commit 4658840
Show file tree
Hide file tree
Showing 12 changed files with 9,077 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
name: CI
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
with:
composer_install: true
# installer contains a sample behat.yml file, though there are no behat tests to run
endtoend: false
# require the following in ci.yml rather than composer.json require-dev specifically for installer because unlike
Expand Down
2 changes: 2 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RewriteEngine On
RewriteRule ^(.*)$ public/$1
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/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
16 changes: 16 additions & 0 deletions app/_config/mysite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
project: app

# UTF8MB4 has limited support in older MySQL versions.
# Remove this configuration if you experience issues.
---
Name: myproject-database
---
SilverStripe\ORM\Connect\MySQLDatabase:
connection_charset: utf8mb4
connection_collation: utf8mb4_unicode_ci
charset: utf8mb4
collation: utf8mb4_unicode_ci
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 = [];
}
}
37 changes: 37 additions & 0 deletions app/src/PageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace {

use SilverStripe\CMS\Controllers\ContentController;

/**
* @template T of Page
* @extends ContentController<T>
*/
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/
}
}
}
48 changes: 45 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
"silverstripe/vendor-plugin": "2.x-dev",
"silverstripe/recipe-cms": "5.x-dev",
"silverstripe-themes/simple": "3.x-dev",
"silverstripe/login-forms": "5.x-dev"
"silverstripe/login-forms": "5.x-dev",
"dnadesign/silverstripe-elemental": "dev-pulls/5/inline-validation as 5.x-dev",
"silverstripe/recipe-testing": "^3",
"mikey179/vfsstream": "^1.6.10",
"silverstripe/admin": "dev-pulls/2/bypass-entwine as 2.x-dev",
"silverstripe/frameworktest": "dev-pulls/1/elemental as 1.x-dev"
},
"require-dev": {
"phpunit/phpunit": "^9.6"
Expand All @@ -22,6 +27,19 @@
"public-files": [
"assets/*",
"favicon.ico"
],
"project-files-installed": [
".htaccess",
"app/.htaccess",
"app/_config/mimevalidator.yml",
"app/_config/mysite.yml",
"app/src/Page.php",
"app/src/PageController.php"
],
"public-files-installed": [
".htaccess",
"index.php",
"web.config"
]
},
"config": {
Expand All @@ -30,8 +48,32 @@
"composer/installers": true,
"silverstripe/recipe-plugin": true,
"silverstripe/vendor-plugin": true
},
"platform": {
"php": "8.1"
}
},
"prefer-stable": true,
"minimum-stability": "dev"
}
"minimum-stability": "dev",
"repositories": {
"x0": {
"type": "vcs",
"url": "[email protected]:creative-commoners/silverstripe-elemental"
},
"x1": {
"type": "vcs",
"url": "[email protected]:creative-commoners/silverstripe-admin"
},
"x3": {
"type": "vcs",
"url": "[email protected]:creative-commoners/silverstripe-frameworktest"
}
},
"conflict": {
"symfony/cache-contracts": "3.2.1",
"symfony/deprecation-contracts": "3.2.1",
"symfony/event-dispatcher-contracts": "3.2.1",
"symfony/service-contracts": "3.2.1",
"symfony/translation-contracts": "3.2.1"
}
}
Loading

0 comments on commit 4658840

Please sign in to comment.