From fc27ad57c518f571a3845d946bf58c627856f003 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 27 Mar 2021 19:11:37 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Move=20settings=20from=20the=20`composer.js?= =?UTF-8?q?on`=20=E2=80=9Cextra=E2=80=9D=20to=20the=20plugin=20main=20clas?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Welch --- composer.json | 8 +------- src/Similar.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 5a8115a..43aff72 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nystudio107/craft-similar", "description": "Similar for Craft lets you find elements, Entries, Categories, Commerce Products, etc, that are similar, based on... other related elements.", "type": "craft-plugin", - "version": "1.1.3", + "version": "1.1.4", "keywords": [ "craft", "cms", @@ -34,13 +34,7 @@ "extra": { "name": "Similar", "handle": "similar", - "schemaVersion": "1.0.0", - "hasCpSettings": false, - "hasCpSection": false, "changelogUrl": "https://raw.githubusercontent.com/nystudio107/craft-similar/v1/CHANGELOG.md", - "components": { - "similar": "nystudio107\\similar\\services\\Similar" - }, "class": "nystudio107\\similar\\Similar" } } diff --git a/src/Similar.php b/src/Similar.php index 4df704c..70a7ba5 100644 --- a/src/Similar.php +++ b/src/Similar.php @@ -44,6 +44,39 @@ class Similar extends Plugin */ public static $plugin; + // Static Methods + // ========================================================================= + + /** + * @inheritdoc + */ + public function __construct($id, $parent = null, array $config = []) + { + $config['components'] = [ + 'similar' => SimilarService::class, + ]; + + parent::__construct($id, $parent, $config); + } + + // Public Properties + // ========================================================================= + + /** + * @var string + */ + public $schemaVersion = '1.0.0'; + + /** + * @var bool + */ + public $hasCpSection = false; + + /** + * @var bool + */ + public $hasCpSettings = false; + // Public Methods // ========================================================================= From 79b9cd33bea361c3b21ef5920f7d588ba8492ba5 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 27 Mar 2021 19:11:45 -0400 Subject: [PATCH 2/2] Version 1.1.4 Signed-off-by: Andrew Welch --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30bbb2c..12084a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Similar Changelog +## 1.1.4 - 2021.03.27 +### Changed +* Move settings from the `composer.json` “extra” to the plugin main class + ## 1.1.3 - 2021.03.27 ### Fixed * Fixed an issue with using `RAND()` in the sort criteria (https://github.com/nystudio107/craft-similar/issues/32)