Skip to content

Commit

Permalink
[AL-1762] - Advance version to 2.0.0 (#1954)
Browse files Browse the repository at this point in the history
* Updated to version 2.0.0

* Fixed unreachable-logger error when plugins are outdated

* Incremented version number to 2.0.0
  • Loading branch information
TeslaDethray authored Feb 20, 2019
1 parent 48587c1 commit 4469aba
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Change Log
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org)

## MASTER
## 2.0.0 - 2019-02-20
### Added
- New `plan:list` command lists the plans available to a site. (#1901)
- New `plan:set` command sets a site's plan. (#1901)
Expand Down
52 changes: 40 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
---

# App
TERMINUS_VERSION: '1.9.1-dev'
TERMINUS_VERSION: '2.0.0'

# Connectivity
TERMINUS_HOST: 'terminus.pantheon.io'
Expand Down
4 changes: 2 additions & 2 deletions src/Terminus.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function __construct(Config $config, InputInterface $input = null, Output

$this->configureContainer();

$this->setLogger($container->get('logger'));

$this->addBuiltInCommandsAndHooks();
$this->addPluginsCommandsAndHooks();

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

$this->setLogger($container->get('logger'));

date_default_timezone_set($config->get('time_zone'));
setlocale(LC_MONETARY, $config->get('monetary_locale'));
}
Expand Down
7 changes: 7 additions & 0 deletions tests/features/plugins.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ Feature: Plugin Commands
[notice] Hello, yd!
"""

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


Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"extra": {
"terminus": {
"compatible-version": "1.*"
"compatible-version": "2.*"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "pantheon-systems/terminus-plugin-example",
"description": "An example Terminus command",
"type": "terminus-plugin",
"license": "MIT",
"extra": {
"terminus": {
"compatible-version": "0.*"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* This command can be invoked by running `terminus with-base-class:hello`
*/

use Pantheon\Terminus\Commands\TerminusCommand;

// NOT RECOMMENDED: if you need to include more source files, define
// an 'autoload' section in your composer.json file instead, and use
// autoloading with a namespace.
include __DIR__ . '/PluginProvidedBaseClass.php';

/**
* Say hello to the user
*/
class HasBaseClassCommand extends PluginProvidedBaseClass
{
/**
* Print the classic message to the log.
*
* @command with-global-base-class:hello
*/
function sayHello()
{
$who = $this->whoToGreet();
$this->log()->notice("Hello, $who!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* This command can be invoked by running `terminus hello`
*/

use Pantheon\Terminus\Commands\TerminusCommand;

/**
* Say hello to the user
*/
class HelloCommand extends TerminusCommand
{
/**
* Print the classic message to the log.
*
* @command global:hello
*/
function sayHello()
{
$this->log()->notice("Hello, World!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* This file shows an example of a base class for Plugin commands.
*/

use Pantheon\Terminus\Commands\TerminusCommand;

/**
* Example base class
*/
class PluginProvidedBaseClass extends TerminusCommand
{
/**
* Provide a utility function
*/
function whoToGreet()
{
return 'everyone';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"extra": {
"terminus": {
"compatible-version": "1.*"
"compatible-version": "2.*"
}
},
"require": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"extra": {
"terminus": {
"compatible-version": "1.*"
"compatible-version": "2.*"
}
}
}

0 comments on commit 4469aba

Please sign in to comment.