Skip to content

Commit 0e7c33b

Browse files
committed
Merge branch 'master' into modern-ui
Includes bumping of plugin versions
2 parents feb5388 + 0a23bb8 commit 0e7c33b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+970
-225
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.DS_Store
55
*.buildpath
66
*.project
7+
*.idea

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Gitter](https://img.shields.io/gitter/room/mantisbt-plugins/source-integration.svg)](https://gitter.im/mantisbt-plugins/source-integration)
44

55
Copyright (c) 2008 - 2012 John Reese - http://noswap.com
6-
Copyright (c) 2012 - 2016 MantisBT Team - [email protected]
6+
Copyright (c) 2012 - 2017 MantisBT Team - [email protected]
77

88
Released under the [MIT license](http://opensource.org/licenses/MIT)
99

@@ -26,6 +26,8 @@ plugins:
2626
[cgit](http://hjemli.net/git/cgit/) web frontend installation.
2727
* **SourceGithub**: Git repositories hosted on [GitHub](http://github.com/).
2828
* **SourceGitlab**: Git repositories hosted on [GitLab](https://about.gitlab.com/).
29+
* **SourceGitphp**: Git repositories accessible via a
30+
[Gitphp](https://gitphp.org/) web frontend installation.
2931
* **SourceGitweb**: Git repositories accessible via a
3032
[GitWeb](https://git.wiki.kernel.org/index.php/Gitweb) web frontend
3133
installation.
@@ -53,15 +55,20 @@ version **1.3.0** or higher.
5355

5456
### Compatibility
5557

58+
The Source Integration framework's version numbering follows
59+
[Semantic Versioning](http://semver.org/). Major version increments indicate a
60+
change in the minimum required MantisBT version.
61+
5662
Depending on which version of MantisBT you are using, please make sure to
57-
get the source code from the appropriate branch in the Plugin's GitHub
58-
repository, as per the table below:
59-
60-
MantisBT version | Branch | Notes
61-
:---:|---|---
62-
2.0.x | [modern-ui](https://github.com/mantisbt-plugins/source-integration/archive/modern-ui.zip) | Beta
63-
1.3.x | [master](https://github.com/mantisbt-plugins/source-integration/archive/master.zip) | **Current release**
64-
1.2.x | [master-1.2.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.2.x.zip) | Legacy
63+
get the appropriate version of the source code.
64+
Use [release tags](https://github.com/mantisbt-plugins/source-integration/releases),
65+
or the relevant branch in the Plugin's GitHub repository, as per the table below:
66+
67+
MantisBT version | Tags | Branch | Notes
68+
:---:|---|---|---
69+
2.0.x | v2.* | [modern-ui](https://github.com/mantisbt-plugins/source-integration/archive/modern-ui.zip) | Beta
70+
1.3.x | v1.* | [master](https://github.com/mantisbt-plugins/source-integration/archive/master.zip) | **Current release**
71+
1.2.x | v0.* | [master-1.2.x](https://github.com/mantisbt-plugins/source-integration/archive/master-1.2.x.zip) | Legacy
6572

6673

6774
### Setup instructions

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.4.0';
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: 14 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',
@@ -25,6 +27,16 @@ public function hooks() {
2527
*/
2628
public $configuration = false;
2729

30+
/**
31+
* Define the VCS's ability to handle links to Pull Requests.
32+
* If false, Pull Request links are not supported; otherwise this should be
33+
* a sprintf template used to build an URL linking to a Pull Request, by
34+
* appending it at the end of url_repo().
35+
* e.g. '/pull/%s', %s being the PR's number
36+
* @var false|string linkPullRequest
37+
*/
38+
public $linkPullRequest = false;
39+
2840
/**
2941
* Get a long, proper string representing the plugin's source control type.
3042
* Should be localized if possible.
@@ -162,7 +174,7 @@ final public function _precommit( $p_event ) {
162174
class SourceGenericPlugin extends MantisSourcePlugin {
163175
function register() {
164176
$this->name = plugin_lang_get( 'title', 'Source' );
165-
$this->version = SourcePlugin::$framework_version;
177+
$this->version = self::FRAMEWORK_VERSION;
166178
}
167179

168180
public $type = 'generic';

0 commit comments

Comments
 (0)