From c698632aae850759c5afa2f89f388c3c7d5da14d Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 16 Jan 2017 18:10:05 +1300 Subject: [PATCH] SS4 compat: Update composer and YAML config, rename classes, update readme --- .travis.yml | 19 ++++--- README.md | 2 +- _config/comments.yml | 2 +- _config/routes.yml | 8 +-- composer.json | 51 +++++++++---------- {code/admin => src/Admin}/CommentAdmin.php | 0 .../admin => src/Admin}/CommentsGridField.php | 0 .../Admin}/CommentsGridFieldAction.php | 0 .../Admin}/CommentsGridFieldBulkAction.php | 0 .../Admin}/CommentsGridFieldConfig.php | 0 {code => src}/Commenting.php | 0 .../Controllers}/CommentingController.php | 0 .../Extensions}/CommentsExtension.php | 0 {code/model => src/Model}/Comment.php | 0 {code/model => src/Model}/CommentList.php | 0 15 files changed, 40 insertions(+), 42 deletions(-) rename {code/admin => src/Admin}/CommentAdmin.php (100%) rename {code/admin => src/Admin}/CommentsGridField.php (100%) rename {code/admin => src/Admin}/CommentsGridFieldAction.php (100%) rename {code/admin => src/Admin}/CommentsGridFieldBulkAction.php (100%) rename {code/admin => src/Admin}/CommentsGridFieldConfig.php (100%) rename {code => src}/Commenting.php (100%) rename {code/controllers => src/Controllers}/CommentingController.php (100%) rename {code/extensions => src/Extensions}/CommentsExtension.php (100%) rename {code/model => src/Model}/Comment.php (100%) rename {code/model => src/Model}/CommentList.php (100%) diff --git a/.travis.yml b/.travis.yml index bbdf9f8..2587d8a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,18 +8,17 @@ addons: - tidy php: - - 5.3 - - 5.4 - 5.5 - 5.6 - 7.0 + - 7.1 before_install: - pip install --user codecov env: global: - - DB=MYSQL CORE_RELEASE=3.1 + - DB=MYSQL CORE_RELEASE=4 - MODULE_PATH=comments # Set to 1 in the matrix to enable code coverage @@ -29,15 +28,15 @@ matrix: include: - php: 5.6 #CommentsListTest breaks with this env: DB=MYSQL CORE_RELEASE=3.2 COVERAGE=1 - env: DB=SQLITE CORE_RELEASE=3.2 COVERAGE=1 + env: DB=SQLITE CORE_RELEASE=4 COVERAGE=1 - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3 - - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3.1 - - php: 5.6 - env: DB=PGSQL CORE_RELEASE=3.2 - allow_failures: + env: DB=MYSQL CORE_RELEASE=4 - php: 7.0 + env: DB=MYSQL CORE_RELEASE=4 + - php: 7.1 + env: DB=MYSQL CORE_RELEASE=4 + - php: 5.6 + env: DB=PGSQL CORE_RELEASE=4 before_script: - phpenv rehash diff --git a/README.md b/README.md index 5c70491..815e672 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ inside the docs folder. ## Requirements - * SilverStripe 3.1 + * SilverStripe ^4.0 ## Installation diff --git a/_config/comments.yml b/_config/comments.yml index cd0abb2..8a09bf0 100644 --- a/_config/comments.yml +++ b/_config/comments.yml @@ -4,6 +4,6 @@ Name: commentssitetree only: moduleexists: 'cms' --- -SiteTree: +SilverStripe\CMS\Model\SiteTree: comments: enabled_cms: true diff --git a/_config/routes.yml b/_config/routes.yml index 959e233..210a7cd 100644 --- a/_config/routes.yml +++ b/_config/routes.yml @@ -2,9 +2,9 @@ Name: commentroutes After: framework/routes#coreroutes --- -Director: +SilverStripe\Control\Director: rules: # handle old 2.4 style urls - 'CommentingController//$Action/$ID/$OtherID': 'CommentingController' - 'PageComments/$Action/$ID/$OtherID': 'CommentingController' - 'PageComments_Controller/$Action/$ID/$OtherID': 'CommentingController' + 'CommentingController//$Action/$ID/$OtherID': 'SilverStripe\Comments\Controllers\CommentingController' + 'PageComments/$Action/$ID/$OtherID': 'SilverStripe\Comments\Controllers\CommentingController' + 'PageComments_Controller/$Action/$ID/$OtherID': 'SilverStripe\Comments\Controllers\CommentingController' diff --git a/composer.json b/composer.json index d114ce4..d889cd8 100644 --- a/composer.json +++ b/composer.json @@ -1,28 +1,27 @@ { - "name": "silverstripe/comments", - "description": "This module provides commenting functionality for Pages and other DataObjects on your SilverStripe site.", - "type": "silverstripe-module", - "keywords": ["silverstripe", "comments"], - "authors": [{ - "name": "Will Rossiter", - "email": "will@fullscreen.io" - }], - "require": { - "assertchris/hash-compat": "~1.0", - "silverstripe/framework": "~3.1", - "colymba/gridfield-bulk-editing-tools": "~2.1" - }, - "suggest": { - "ezyang/htmlpurifier": "Standards compliant HTML filter written in PHP", - "silverstripe/cms": "The SilverStripe Content Management System" - }, - "require-dev": { - "phpunit/PHPUnit": "~3.7@stable" - }, - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "license": "BSD-3-Clause" + "name": "silverstripe/comments", + "description": "This module provides commenting functionality for Pages and other DataObjects on your SilverStripe site.", + "type": "silverstripe-module", + "keywords": ["silverstripe", "comments"], + "authors": [{ + "name": "Will Rossiter", + "email": "will@fullscreen.io" + }], + "require": { + "silverstripe/framework": "^4.0@dev", + "colymba/gridfield-bulk-editing-tools": "~2.1" + }, + "suggest": { + "ezyang/htmlpurifier": "Standards compliant HTML filter written in PHP", + "silverstripe/cms": "The SilverStripe Content Management System" + }, + "require-dev": { + "phpunit/PHPUnit": "~4.8" + }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "license": "BSD-3-Clause" } diff --git a/code/admin/CommentAdmin.php b/src/Admin/CommentAdmin.php similarity index 100% rename from code/admin/CommentAdmin.php rename to src/Admin/CommentAdmin.php diff --git a/code/admin/CommentsGridField.php b/src/Admin/CommentsGridField.php similarity index 100% rename from code/admin/CommentsGridField.php rename to src/Admin/CommentsGridField.php diff --git a/code/admin/CommentsGridFieldAction.php b/src/Admin/CommentsGridFieldAction.php similarity index 100% rename from code/admin/CommentsGridFieldAction.php rename to src/Admin/CommentsGridFieldAction.php diff --git a/code/admin/CommentsGridFieldBulkAction.php b/src/Admin/CommentsGridFieldBulkAction.php similarity index 100% rename from code/admin/CommentsGridFieldBulkAction.php rename to src/Admin/CommentsGridFieldBulkAction.php diff --git a/code/admin/CommentsGridFieldConfig.php b/src/Admin/CommentsGridFieldConfig.php similarity index 100% rename from code/admin/CommentsGridFieldConfig.php rename to src/Admin/CommentsGridFieldConfig.php diff --git a/code/Commenting.php b/src/Commenting.php similarity index 100% rename from code/Commenting.php rename to src/Commenting.php diff --git a/code/controllers/CommentingController.php b/src/Controllers/CommentingController.php similarity index 100% rename from code/controllers/CommentingController.php rename to src/Controllers/CommentingController.php diff --git a/code/extensions/CommentsExtension.php b/src/Extensions/CommentsExtension.php similarity index 100% rename from code/extensions/CommentsExtension.php rename to src/Extensions/CommentsExtension.php diff --git a/code/model/Comment.php b/src/Model/Comment.php similarity index 100% rename from code/model/Comment.php rename to src/Model/Comment.php diff --git a/code/model/CommentList.php b/src/Model/CommentList.php similarity index 100% rename from code/model/CommentList.php rename to src/Model/CommentList.php