Skip to content

Commit 4469aba

Browse files
authored
[AL-1762] - Advance version to 2.0.0 (#1954)
* Updated to version 2.0.0 * Fixed unreachable-logger error when plugins are outdated * Incremented version number to 2.0.0
1 parent 48587c1 commit 4469aba

File tree

12 files changed

+135
-19
lines changed

12 files changed

+135
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Change Log
22
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org)
33

4-
## MASTER
4+
## 2.0.0 - 2019-02-20
55
### Added
66
- New `plan:list` command lists the plans available to a site. (#1901)
77
- New `plan:set` command sets a site's plan. (#1901)

composer.lock

Lines changed: 40 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/constants.yml

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

99
# App
10-
TERMINUS_VERSION: '1.9.1-dev'
10+
TERMINUS_VERSION: '2.0.0'
1111

1212
# Connectivity
1313
TERMINUS_HOST: 'terminus.pantheon.io'

src/Terminus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public function __construct(Config $config, InputInterface $input = null, Output
7575

7676
$this->configureContainer();
7777

78+
$this->setLogger($container->get('logger'));
79+
7880
$this->addBuiltInCommandsAndHooks();
7981
$this->addPluginsCommandsAndHooks();
8082

@@ -86,8 +88,6 @@ public function __construct(Config $config, InputInterface $input = null, Output
8688
$this->runner = new RoboRunner();
8789
$this->runner->setContainer($container);
8890

89-
$this->setLogger($container->get('logger'));
90-
9191
date_default_timezone_set($config->get('time_zone'));
9292
setlocale(LC_MONETARY, $config->get('monetary_locale'));
9393
}

tests/features/plugins.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,12 @@ Feature: Plugin Commands
5353
[notice] Hello, yd!
5454
"""
5555

56+
Scenario: Running a simple plugin command that needs autoloading for its base class
57+
When I am using "outdated" plugins
58+
And I run "terminus global:hello"
59+
Then I should get:
60+
"""
61+
[warning] Could not load plugin pantheon-systems/terminus-plugin-example because it is not compatible with this version of Terminus.
62+
"""
5663

5764

tests/fixtures/functional/plugins/no-namespace/plugin-example/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"extra": {
77
"terminus": {
8-
"compatible-version": "1.*"
8+
"compatible-version": "2.*"
99
}
1010
}
1111
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "pantheon-systems/terminus-plugin-example",
3+
"description": "An example Terminus command",
4+
"type": "terminus-plugin",
5+
"license": "MIT",
6+
"extra": {
7+
"terminus": {
8+
"compatible-version": "0.*"
9+
}
10+
}
11+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* This command can be invoked by running `terminus with-base-class:hello`
4+
*/
5+
6+
use Pantheon\Terminus\Commands\TerminusCommand;
7+
8+
// NOT RECOMMENDED: if you need to include more source files, define
9+
// an 'autoload' section in your composer.json file instead, and use
10+
// autoloading with a namespace.
11+
include __DIR__ . '/PluginProvidedBaseClass.php';
12+
13+
/**
14+
* Say hello to the user
15+
*/
16+
class HasBaseClassCommand extends PluginProvidedBaseClass
17+
{
18+
/**
19+
* Print the classic message to the log.
20+
*
21+
* @command with-global-base-class:hello
22+
*/
23+
function sayHello()
24+
{
25+
$who = $this->whoToGreet();
26+
$this->log()->notice("Hello, $who!");
27+
}
28+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* This command can be invoked by running `terminus hello`
4+
*/
5+
6+
use Pantheon\Terminus\Commands\TerminusCommand;
7+
8+
/**
9+
* Say hello to the user
10+
*/
11+
class HelloCommand extends TerminusCommand
12+
{
13+
/**
14+
* Print the classic message to the log.
15+
*
16+
* @command global:hello
17+
*/
18+
function sayHello()
19+
{
20+
$this->log()->notice("Hello, World!");
21+
}
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* This file shows an example of a base class for Plugin commands.
4+
*/
5+
6+
use Pantheon\Terminus\Commands\TerminusCommand;
7+
8+
/**
9+
* Example base class
10+
*/
11+
class PluginProvidedBaseClass extends TerminusCommand
12+
{
13+
/**
14+
* Provide a utility function
15+
*/
16+
function whoToGreet()
17+
{
18+
return 'everyone';
19+
}
20+
}

0 commit comments

Comments
 (0)