Skip to content

Instantly share code, notes, and snippets.

View sminnee's full-sized avatar

Sam Minnée sminnee

View GitHub Profile
@sminnee
sminnee / slow-tests.txt
Created June 28, 2017 05:20
Slow PHPUnit tests in SilverStripe framework
These are the slow tests as of 28 June 2017
✔ SilverStripe\Control\Tests\ControllerTest: Test Default Action (1455 ms)
✔ SilverStripe\Control\Tests\ControllerTest: Test Method Actions (617 ms)
✔ SilverStripe\Control\Tests\ControllerTest: Test Template Actions (609 ms)
✔ SilverStripe\Control\Tests\ControllerTest: Test Undefined Actions (612 ms)
✔ SilverStripe\Control\Tests\ControllerTest: Test Allowed Actions (742 ms)
✔ SilverStripe\Control\Tests\ControllerTest: Test Wildcard Allowed Actions (607 ms)
✔ SilverStripe\Control\Tests\ControllerTest: Test Join Links (611 ms)
✔ SilverStripe\Control\Tests\ControllerTest: Test Link (604 ms)
diff --git a/main.go b/main.go
index 81cafd4..f83a559 100644
--- a/main.go
+++ b/main.go
@@ -14,6 +14,7 @@ import (
"strings"
"sync"
"time"
+ "context"
)
diff --git a/src/Control/Director.php b/src/Control/Director.php
index ac4ee9d..dc4c30b 100644
--- a/src/Control/Director.php
+++ b/src/Control/Director.php
@@ -168,6 +168,7 @@ class Director implements TemplateGlobalProvider
// Initiate an empty session - doesn't initialize an actual PHP session until saved (see below)
$session = Session::create(isset($_SESSION) ? $_SESSION : array());
+ Injector::inst()->registerService($session, Session::class);
diff --git a/_config/security.yml b/_config/security.yml
index 039e089..844e3bb 100644
--- a/_config/security.yml
+++ b/_config/security.yml
@@ -8,5 +8,23 @@ SilverStripe\Security\Security:
default: SilverStripe\Security\MemberAuthenticator\Authenticator
cms: SilverStripe\Security\MemberAuthenticator\CMSAuthenticator
+SilverStripe\Core\Injector\Injector:
+ SilverStripe\Control\RequestProcessor:
Verifying that "sminnee.id" is my Blockstack ID. https://onename.com/sminnee
commit 6ece0a51312e49d8d2d17d416487ec5a9f3731e6
Author: Sam Minnee <sam@silverstripe.com>
Date: Wed Apr 26 16:40:20 2017 +1200
FIX: Lock testsession to alpha6
Every alpha release may have API changes so we should be conservative
in our version requirements.
diff --git a/composer.json b/composer.json
diff --git a/composer.json b/composer.json
index dccb639..0371f61 100644
--- a/composer.json
+++ b/composer.json
@@ -24,7 +24,7 @@
"behat/mink-extension": "~1.3.0",
"behat/mink-selenium2-driver": "~1.2.0",
"symfony/dom-crawler": "~2.0",
- "silverstripe/testsession": "^2.0.0-alpha2",
+ "silverstripe/testsession": "2.0.0-alpha6",
@sminnee
sminnee / foo.diff
Last active May 1, 2017 07:20
The world's most useless 2FA
diff --git a/mysite/code/CustomAuthenticator.php b/mysite/code/CustomAuthenticator.php
new file mode 100644
index 0000000..141a9f1
--- /dev/null
+++ b/mysite/code/CustomAuthenticator.php
@@ -0,0 +1,14 @@
+<?php
+
+use SilverStripe\Security\MemberAuthenticator\Authenticator;
+
diff --git a/mysite/code/CustomAuthenticator.php b/mysite/code/CustomAuthenticator.php
new file mode 100644
index 0000000..141a9f1
--- /dev/null
+++ b/mysite/code/CustomAuthenticator.php
@@ -0,0 +1,14 @@
+<?php
+
+use SilverStripe\Security\MemberAuthenticator\Authenticator;
+
diff --git a/mysite/code/CustomAuthenticator.php b/mysite/code/CustomAuthenticator.php
new file mode 100644
index 0000000..141a9f1
--- /dev/null
+++ b/mysite/code/CustomAuthenticator.php
@@ -0,0 +1,14 @@
+<?php
+
+use SilverStripe\Security\MemberAuthenticator\Authenticator;
+