Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SS4 Compatibility #23

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: false
11 changes: 7 additions & 4 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
inherit: true

build:
nodes:
analysis:
tests:
override: [php-scrutinizer-run]

checks:
php:
code_rating: true
duplication: true

filter:
paths: [code/*, tests/*]

tools:
external_code_coverage: true
paths: [src/*, tests/*]
44 changes: 29 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details

sudo: false

language: php

php:
- 5.6

env:
- DB=MYSQL CORE_RELEASE=3.6
global:
- COMPOSER_ROOT_VERSION=2.x-dev

matrix:
include:
- php: 5.6
env: DB=MYSQL RECIPE_VERSION=1.0.x-dev PHPUNIT_TEST=1 PHPCS_TEST=1
- php: 5.6
env: DB=MYSQL RECIPE_VERSION=1.1.x-dev PHPUNIT_TEST=1
- php: 7.0
env: DB=PGSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_TEST=1
- php: 7.1
env: DB=PGSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_COVERAGE_TEST=1

before_script:
- composer self-update || true
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
- composer install
# Init PHP
- phpenv rehash
- phpenv config-rm xdebug.ini || true

- composer require --no-update silverstripe/recipe-cms "$RECIPE_VERSION"
# Note: Postgres version is for SilverStripe >= 4.2.x
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.1.x-dev; fi
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile

script:
- vendor/bin/phpunit --coverage-clover=coverage.clover realme/tests/
- bash <(curl -s https://codecov.io/bash) -f coverage.clover -R realme/
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi

after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
14 changes: 14 additions & 0 deletions .upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mappings:
RealMeMemberExtension: SilverStripe\RealMe\Extension\MemberExtension
RealMeSecurityExtension: SilverStripe\RealMe\Extension\SecurityExtension
RealMeSiteTreeExtension: SilverStripe\RealMe\Extension\SiteTreeExtension
RealMeService: SilverStripe\RealMe\RealMeService
RealMeLoginForm: SilverStripe\RealMe\Authenticator\LoginForm
RealMeSetupTask: SilverStripe\RealMe\Task\RealMeSetupTask
RealMeFederatedIdentity: SilverStripe\RealMe\Model\FederatedIdentity
RealMeUser: SilverStripe\RealMe\Model\User
RealMeAuthenticator: SilverStripe\RealMe\Authenticator
RealMeException: SilverStripe\RealMe\Exception
RealMeMiniLoginForm: SilverStripe\RealMe\Authenticator\MiniLoginForm
RealMeServiceTest: SilverStripe\RealMe\Tests\RealMeServiceTest
RealMeSetupTaskTest: SilverStripe\RealMe\Tests\RealMeSetupTaskTest
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ responses, hence the custom `repositories` section.

Once installation is completed, configuration is required before this module will work - see below.

#### Using in PHP 7.1

If you are installing this module on PHP 7.1 you may have to supress deprecation notices as this module requires `php-saml` which relies on the deprecated mcrypt library. You can add to your sites `_config.php` file:

```php
use SilverStripe\Control\Director;

if (Director::isDev()) {
error_reporting(E_ALL ^ E_DEPRECATED);
}
```

## Configuration of RealMe for your application

RealMe provide two testing environments and a production environment for you to integrate with. Access to these
Expand All @@ -69,8 +81,7 @@ used.

## Providing RealMe login buttons

By default, the module integrates with the `Authenticator` class in SilverStripe, extending the standard SilverStripe
login form. If you want to provide your own separate login form just for RealMe, then the built-in templates can help
By default, the module provides an `Authenticator` class in SilverStripe, adding a new login form. If you want to provide your own separate login form just for RealMe, then the built-in templates can help
with this. They have been designed to integrate as cleanly as possible with SilverStripe templates, but it is up to you
whether you use them, or roll your own.

Expand All @@ -90,7 +101,7 @@ class RealMeTestController extends Controller {
public $realMeService;

private static $dependencies = array(
'realMeService' => '%$RealMeService'
'realMeService' => '%$SilverStripe/RealMe/RealMeService'
);

public function index() {
Expand Down
9 changes: 0 additions & 9 deletions _config.php

This file was deleted.

8 changes: 8 additions & 0 deletions _config/auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
Name: realmeauthentication
---
SilverStripe\Core\Injector\Injector:
SilverStripe\Security\Security:
properties:
Authenticators:
RealMe: %$SilverStripe\RealMe\Authenticator
8 changes: 8 additions & 0 deletions _config/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
Name: realmecache
---
SilverStripe\Core\Injector\Injector:
Psr\SimpleCache\CacheInterface.realMeAuthenticator:
factory: SilverStripe\Core\Cache\CacheFactory
constructor:
namespace: realMeAuthenticator
4 changes: 2 additions & 2 deletions _config/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: RealMe
---
RealMeLoginForm:
include_jquery: false
SilverStripe\RealMe\Authenticator\LoginForm:
include_javascript: true
include_css: true
widget_theme: default
10 changes: 5 additions & 5 deletions _config/extensions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SiteTree:
---
Name: realmeextensions
---
SilverStripe\CMS\Model\SiteTree:
extensions:
- RealMeSiteTreeExtension
Security:
extensions:
- RealMeSecurityExtension
- SilverStripe\RealMe\Extension\SiteTreeExtension
4 changes: 2 additions & 2 deletions css/realme.css → client/css/realme.css
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@
}

.realme_arrow_side_left {
top: -1em;
left: 100%;
top: -26em;
left: calc(100% + 25px);
}
.realme_arrow_side_left .arrow {
width: 0;
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
59 changes: 0 additions & 59 deletions code/RealMeAuthenticator.php

This file was deleted.

Loading