File tree Expand file tree Collapse file tree 4 files changed +33
-8
lines changed Expand file tree Collapse file tree 4 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ # Copyright (c) 2017 Damien Regad
4+ # Licensed under the MIT license
5+
6+ require_once ( config_get_global ( 'class_path ' ) . 'MantisPlugin.class.php ' );
7+
8+ /**
9+ * Class MantisSourceBase
10+ *
11+ * Base class for all Source Integration Plugin classes
12+ */
13+ abstract class MantisSourceBase extends MantisPlugin
14+ {
15+ /**
16+ * Source Integration framework version.
17+ *
18+ * Numbering follows Semantic Versioning. Major version increments indicate
19+ * a change in the minimum required MantisBT version: 0=1.2; 1=1.3, 2=2.x.
20+ * The framework version is incremented when the plugin's core file change.
21+ */
22+ const FRAMEWORK_VERSION = '1.3.1 ' ;
23+ }
Original file line number Diff line number Diff line change 33# Copyright (c) 2012 John Reese
44# Licensed under the MIT license
55
6+ require_once ( 'MantisSourceBase.class.php ' );
7+
68/**
79 * Abstract class for simplifying creation of source control plugins.
810 * @author John Reese
911 */
10- abstract class MantisSourcePlugin extends MantisPlugin {
12+ abstract class MantisSourcePlugin extends MantisSourceBase {
1113 public function hooks () {
1214 return array (
1315 'EVENT_SOURCE_INTEGRATION ' => 'integration ' ,
@@ -172,7 +174,7 @@ final public function _precommit( $p_event ) {
172174class SourceGenericPlugin extends MantisSourcePlugin {
173175 function register () {
174176 $ this ->name = plugin_lang_get ( 'title ' , 'Source ' );
175- $ this ->version = SourcePlugin:: $ framework_version ;
177+ $ this ->version = self :: FRAMEWORK_VERSION ;
176178 }
177179
178180 public $ type = 'generic ' ;
Original file line number Diff line number Diff line change 33# Copyright (c) 2012 John Reese
44# Licensed under the MIT license
55
6- require_once ( config_get_global ( ' class_path ' ) . ' MantisPlugin .class.php ' );
6+ require_once ( ' MantisSourceBase .class.php ' );
77
88/**
99 * Creates an extensible API for integrating source control applications
1010 * with the Mantis bug tracker software.
1111 */
12- class SourcePlugin extends MantisPlugin {
13- static $ framework_version = ' 1.3.1 ' ;
12+ class SourcePlugin extends MantisSourceBase {
13+
1414 static $ cache = array ();
1515
1616 /**
@@ -28,7 +28,7 @@ function register() {
2828 $ this ->name = plugin_lang_get ( 'title ' );
2929 $ this ->description = plugin_lang_get ( 'description ' );
3030
31- $ this ->version = self ::$ framework_version ;
31+ $ this ->version = self ::FRAMEWORK_VERSION ;
3232 $ this ->requires = array (
3333 'MantisCore ' => '1.3.0 ' ,
3434 );
Original file line number Diff line number Diff line change 33# Copyright (c) 2012 John Reese
44# Licensed under the MIT license
55
6- final class SourceIntegrationPlugin extends MantisPlugin {
6+ final class SourceIntegrationPlugin extends MantisSourceBase {
77 function register () {
88 $ this ->name = plugin_lang_get ( 'title ' , 'Source ' );
9- $ this ->version = SourcePlugin:: $ framework_version ;
9+ $ this ->version = self :: FRAMEWORK_VERSION ;
1010 }
1111
1212 function hooks () {
You can’t perform that action at this time.
0 commit comments