Skip to content

Commit bb219a6

Browse files
committed
Merge branch 'versioning'
Standardize the framework and plugins version numbering and dependencies.
2 parents ac096b4 + 2c763a0 commit bb219a6

25 files changed

+172
-65
lines changed

Source/MantisSourceBase.class.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.2';
23+
24+
/**
25+
* Minimum required MantisBT version.
26+
* Used to define the MantisCore dependency for all child plugins
27+
*/
28+
const MANTIS_VERSION = '1.3.0';
29+
}

Source/MantisSourcePlugin.class.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
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 ) {
172174
class 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';

Source/Source.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
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,18 +28,15 @@ 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(
33-
'MantisCore' => '1.3.0',
34-
);
35-
$this->uses = array(
36-
'jQuery' => '1.3',
33+
'MantisCore' => self::MANTIS_VERSION,
3734
);
3835
$this->page = 'manage_config_page';
3936

4037
$this->author = 'John Reese';
4138
$this->contact = '[email protected]';
42-
$this->url = 'http://noswap.com';
39+
$this->url = 'https://github.com/mantisbt-plugins/source-integration/';
4340
}
4441

4542
function config() {

Source/SourceIntegration.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
# Copyright (c) 2012 John Reese
44
# Licensed under the MIT license
55

6-
final class SourceIntegrationPlugin extends MantisPlugin {
6+
/**
7+
* Class SourceIntegrationPlugin
8+
*
9+
* Child plugin handling the framework's integration with the MantisBT UI
10+
*/
11+
final class SourceIntegrationPlugin extends MantisSourceBase {
712
function register() {
813
$this->name = plugin_lang_get( 'title', 'Source' );
9-
$this->version = SourcePlugin::$framework_version;
14+
$this->version = self::FRAMEWORK_VERSION;
1015
}
1116

1217
function hooks() {

SourceBitBucket/SourceBitBucket.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
require_once(config_get( 'core_path' ) . 'json_api.php');
1111

1212
class SourceBitBucketPlugin extends MantisSourcePlugin {
13+
14+
const PLUGIN_VERSION = '1.0.0';
15+
const FRAMEWORK_VERSION_REQUIRED = '1.3.2';
16+
1317
protected $main_url = "https://bitbucket.org/";
1418
protected $api_url_10 = 'https://bitbucket.org/api/1.0/';
1519
protected $api_url_20 = 'https://bitbucket.org/api/2.0/';
@@ -20,15 +24,15 @@ public function register() {
2024
$this->name = plugin_lang_get( 'title' );
2125
$this->description = plugin_lang_get( 'description' );
2226

23-
$this->version = '0.19';
27+
$this->version = self::PLUGIN_VERSION;
2428
$this->requires = array(
25-
'MantisCore' => '1.3.0',
26-
'Source' => '0.18',
29+
'MantisCore' => self::MANTIS_VERSION,
30+
'Source' => self::FRAMEWORK_VERSION_REQUIRED,
2731
);
2832

2933
$this->author = 'Sergey Marchenko';
3034
$this->contact = '[email protected]';
31-
$this->url = 'http://zetabyte.ru';
35+
$this->url = 'https://github.com/mantisbt-plugins/source-integration/';
3236

3337
}
3438

SourceBitBucket/lang/strings_english.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
$s_plugin_SourceBitBucket_ = '';
44
$s_plugin_SourceBitBucket_bitbucket = 'BitBucket';
5-
$s_plugin_SourceBitBucket_title = 'BitBucket Integration';
5+
$s_plugin_SourceBitBucket_title = 'Source BitBucket Integration';
66
$s_plugin_SourceBitBucket_description = 'Adds BitBucket integration to the Source Integration framework.';
77

88
$s_plugin_SourceBitBucket_bit_basic_login = 'BitBucket login (for basic auth)';

SourceCgit/SourceCgit.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@
1515
}
1616

1717
class SourceCgitPlugin extends MantisSourcePlugin {
18+
19+
const PLUGIN_VERSION = '1.0.0';
20+
const FRAMEWORK_VERSION_REQUIRED = '1.3.2';
21+
1822
public function register() {
1923
$this->name = plugin_lang_get( 'title' );
2024
$this->description = plugin_lang_get( 'description' );
2125

22-
$this->version = '0.16';
26+
$this->version = self::PLUGIN_VERSION;
2327
$this->requires = array(
24-
'MantisCore' => '1.3.0',
25-
'Source' => '0.16',
28+
'MantisCore' => self::MANTIS_VERSION,
29+
'Source' => self::FRAMEWORK_VERSION_REQUIRED,
2630
);
2731

2832
$this->author = 'Alexander';
2933
$this->contact = '[email protected]';
30-
$this->url = 'http://noswap.com/';
34+
$this->url = 'https://github.com/mantisbt-plugins/source-integration/';
3135
}
3236

3337
public $type = 'cgit';

SourceCgit/lang/strings_english.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
$s_plugin_SourceCgit_ = '';
77
$s_plugin_SourceCgit_cgit = 'Cgit';
8-
$s_plugin_SourceCgit_title = 'Cgit Integration';
8+
$s_plugin_SourceCgit_title = 'Source Cgit Integration';
99
$s_plugin_SourceCgit_description = 'Adds Cgit integration to the Source Integration framework.';
1010

1111
$s_plugin_SourceCgit_cgit_root = 'Cgit Root URL<br/><span class="small">(including trailing /)</span>';

SourceGithub/SourceGithub.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
class SourceGithubPlugin extends MantisSourcePlugin {
1313

14+
const PLUGIN_VERSION = '1.3.1';
15+
const FRAMEWORK_VERSION_REQUIRED = '1.3.2';
16+
1417
const ERROR_INVALID_PRIMARY_BRANCH = 'invalid_branch';
1518

1619
public $linkPullRequest = '/pull/%s';
@@ -19,15 +22,15 @@ public function register() {
1922
$this->name = plugin_lang_get( 'title' );
2023
$this->description = plugin_lang_get( 'description' );
2124

22-
$this->version = '1.3.0';
25+
$this->version = self::PLUGIN_VERSION;
2326
$this->requires = array(
24-
'MantisCore' => '1.3.0',
25-
'Source' => '1.3.0',
27+
'MantisCore' => self::MANTIS_VERSION,
28+
'Source' => self::FRAMEWORK_VERSION_REQUIRED,
2629
);
2730

2831
$this->author = 'John Reese';
2932
$this->contact = '[email protected]';
30-
$this->url = 'http://noswap.com';
33+
$this->url = 'https://github.com/mantisbt-plugins/source-integration/';
3134
}
3235

3336
public function errors() {

SourceGithub/lang/strings_english.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
$s_plugin_SourceGithub_ = '';
77
$s_plugin_SourceGithub_github = 'GitHub';
8-
$s_plugin_SourceGithub_title = 'GitHub Integration';
8+
$s_plugin_SourceGithub_title = 'Source GitHub Integration';
99
$s_plugin_SourceGithub_description = 'Adds GitHub integration to the Source Integration framework.';
1010

1111
$s_plugin_SourceGithub_hub_username = 'GitHub Username';

0 commit comments

Comments
 (0)