Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabea David committed Mar 10, 2017
2 parents 28d02dd + 17fc900 commit 81829fe
Show file tree
Hide file tree
Showing 45 changed files with 292 additions and 309 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
# wireshell
**ProcessWire command-line companion**

Version 1.0.1, compatibility: ProcessWire 3.x
Version 1.0.2, compatibility: ProcessWire 3.x

A command-line interface for CMS/CMF [ProcessWire](https://processwire.com) based on the Symfony Console component.
Can be easily extended through ProcessWire's ability of being bootstrapped into other applications, its great [API](https://processwire.com/api/) and
Expand Down
2 changes: 1 addition & 1 deletion app/wireshell.php
Expand Up @@ -46,7 +46,7 @@
require __DIR__.'/../vendor/autoload.php';
}

$app = new Application('wireshell - An extendable ProcessWire CLI', '1.0.1');
$app = new Application('wireshell - An extendable ProcessWire CLI', '1.0.2');

$app->add(new UserCreateCommand());
$app->add(new UserUpdateCommand());
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.md
Expand Up @@ -4,6 +4,11 @@ Dates using [ISO 8601 Format](http://www.iso.org/iso/iso8601) (YYYY-MM-DD).

Check whether the latest build has passed: [Builds | Read the Docs](https://readthedocs.org/projects/wireshell/builds/)

**1.0.2** (2017-03-10)

- Fixes parse error for usage with php below version 7
- Adds missing directory separator, check if there is one first

**1.0.1** (2017-02-02)

- Adapts `new` command, allows empty database password (`wireshell new prjct --dbPass=""`)
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/common.md
Expand Up @@ -158,7 +158,7 @@ $ wireshell status --php --image
=============== =====================
wireshell
=============== =====================
Version 1.0.1
Version 1.0.2
Documentation http://wireshell.pw
License MIT
=============== =====================
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Expand Up @@ -2,7 +2,7 @@

**ProcessWire command-line companion**

Version 1.0.1, compatibility: ProcessWire 3.x
Version 1.0.2, compatibility: ProcessWire 3.x

A command-line interface for CMS/CMF [ProcessWire](https://processwire.com) based on the Symfony Console component.
Can be easily extended through ProcessWire's ability of being bootstrapped into other applications, its great [API](https://processwire.com/api/) and
Expand Down
3 changes: 1 addition & 2 deletions src/Commands/Backup/BackupDatabaseCommand.php
Expand Up @@ -37,8 +37,7 @@ protected function configure() {
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output) {
parent::setOutput($output)::setInput($input)::bootstrapProcessWire();

$this->init($input, $output);
$tools = new Tools($output);
$tools->writeBlockCommand($this->getName());

Expand Down
3 changes: 1 addition & 2 deletions src/Commands/Backup/BackupImagesCommand.php
Expand Up @@ -34,8 +34,7 @@ protected function configure() {
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output) {
parent::setOutput($output)::setInput($input)::bootstrapProcessWire();

$this->init($input, $output);
$tools = new Tools($output);
$tools->writeBlockCommand($this->getName());

Expand Down
3 changes: 1 addition & 2 deletions src/Commands/Common/CheatCommand.php
Expand Up @@ -38,9 +38,8 @@ protected function configure() {
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output) {
parent::setOutput($output);
$this->init($input, $output);
$tools = new Tools($output);

$tools->writeBlockCommand($this->getName());

$tools->writeBlockBasic(array(
Expand Down
3 changes: 1 addition & 2 deletions src/Commands/Common/DebugCommand.php
Expand Up @@ -31,8 +31,7 @@ protected function configure() {
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output) {
parent::setOutput($output)::setInput($input)::bootstrapProcessWire();

$this->init($input, $output);
$tools = new Tools($output);
$tools
->setInput($input)
Expand Down
3 changes: 1 addition & 2 deletions src/Commands/Common/ServeCommand.php
Expand Up @@ -30,8 +30,7 @@ protected function configure() {
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output) {
parent::checkForProcessWire($output);

$this->checkForProcessWire($output);
$output->writeln("Starting PHP server at localhost:8000");
passthru("php -S localhost:8000");
}
Expand Down
272 changes: 136 additions & 136 deletions src/Commands/Common/StatusCommand.php
Expand Up @@ -24,159 +24,159 @@
*/
class StatusCommand extends PwConnector {

/**
* Configures the current command.
*/
protected function configure() {
$this
->setName('status')
->setDescription('Returns versions, paths and environment info')
->addOption('image', null, InputOption::VALUE_NONE, 'get Diagnose for Imagehandling')
->addOption('php', null, InputOption::VALUE_NONE, 'get Diagnose for PHP')
->addOption('pass', null, InputOption::VALUE_NONE, 'display database password');
/**
* Configures the current command.
*/
protected function configure() {
$this
->setName('status')
->setDescription('Returns versions, paths and environment info')
->addOption('image', null, InputOption::VALUE_NONE, 'get Diagnose for Imagehandling')
->addOption('php', null, InputOption::VALUE_NONE, 'get Diagnose for PHP')
->addOption('pass', null, InputOption::VALUE_NONE, 'display database password');
}

/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output) {
$this->init($input, $output);
$this->tools = new Tools($output);
$tables = new Tables($output);
$stTables = array();

$this->tools->writeBlockCommand($this->getName());

$pwStatus = $this->getPWStatus($input->getOption('pass'));
$wsStatus = $this->getWsStatus();

$stTables[] = $tables->buildTable($pwStatus, 'ProcessWire');
$stTables[] = $tables->buildTable($wsStatus, 'wireshell');

if ($input->getOption('php')) {
$phpStatus = $this->getDiagnosePHP();
$stTables[] = $tables->buildTable($phpStatus, 'PHP Diagnostics');
}

/**
* @param InputInterface $input
* @param OutputInterface $output
* @return int|null|void
*/
protected function execute(InputInterface $input, OutputInterface $output) {
parent::setOutput($output)::bootstrapProcessWire();
$this->tools = new Tools($output);
$tables = new Tables($output);
$stTables = array();

$this->tools->writeBlockCommand($this->getName());

$pwStatus = $this->getPWStatus($input->getOption('pass'));
$wsStatus = $this->getWsStatus();

$stTables[] = $tables->buildTable($pwStatus, 'ProcessWire');
$stTables[] = $tables->buildTable($wsStatus, 'wireshell');
if ($input->getOption('image')) {
$phpStatus = $this->getDiagnoseImagehandling();
$stTables[] = $tables->buildTable($phpStatus, 'Image Diagnostics');
}

if ($input->getOption('php')) {
$phpStatus = $this->getDiagnosePHP();
$stTables[] = $tables->buildTable($phpStatus, 'PHP Diagnostics');
}
$tables->renderTables($stTables);
}

if ($input->getOption('image')) {
$phpStatus = $this->getDiagnoseImagehandling();
$stTables[] = $tables->buildTable($phpStatus, 'Image Diagnostics');
}
/**
* @return array
*/
protected function getPWStatus($showPass) {
$config = \ProcessWire\wire('config');
$on = $this->tools->writeInfo('On', false);
$off = $this->tools->writeComment('Off', false);
$none = $this->tools->writeComment('None', false);

$tables->renderTables($stTables);
}
$version = $config->version;
$latestVersion = parent::getVersion();

/**
* @return array
*/
protected function getPWStatus($showPass) {
$config = \ProcessWire\wire('config');
$on = $this->tools->writeInfo('On', false);
$off = $this->tools->writeComment('Off', false);
$none = $this->tools->writeComment('None', false);

$version = $config->version;
$latestVersion = parent::getVersion();

if ($version !== $latestVersion) {
$version .= ' ' . $this->tools->writeMark("(upgrade available: $latestVersion)", false);
}

$adminUrl = $this->tools->writeLink($this->getAdminUrl(), false);
$advancedMode = $config->advanced ? $on : $off;
$debugMode = $config->debug ? $on : $off;
$timezone = $config->timezone;
$hosts = implode(", ", $config->httpHosts);
$adminTheme = $config->defaultAdminTheme;
$dbHost = $config->dbHost;
$dbName = $config->dbName;
$dbUser = $config->dbUser;
$dbPass = $showPass ? $config->dbPass : '*****';
$dbPort = $config->dbPort;

$prepended = trim($config->prependTemplateFile);
$appended = trim($config->appendTemplateFile);
$prependedTemplateFile = $prepended != '' ? $prepended : $none;
$appendedTemplateFile = $appended != '' ? $appended : $none;

$installPath = getcwd();

$status = [
['Version', $version],
['Admin URL', $adminUrl],
['Advanced mode', $advancedMode],
['Debug mode', $debugMode],
['Timezone', $timezone],
['HTTP hosts', $hosts],
['Admin theme', $adminTheme],
['Prepended template file', $prependedTemplateFile],
['Appended template file', $appendedTemplateFile],
['Database host', $dbHost],
['Database name', $dbName],
['Database user', $dbUser],
['Database password', $dbPass],
['Database port', $dbPort],
['Installation path', $installPath]
];

return $status;
if ($version !== $latestVersion) {
$version .= ' ' . $this->tools->writeMark("(upgrade available: $latestVersion)", false);
}

/**
* @return array
*/
protected function getWsStatus() {
return array(
array('Version', $this->getApplication()->getVersion()),
array('Documentation', $this->tools->writeLink('https://docs.wireshell.pw', false)),
array('License', 'MIT')
);
$adminUrl = $this->tools->writeLink($this->getAdminUrl(), false);
$advancedMode = $config->advanced ? $on : $off;
$debugMode = $config->debug ? $on : $off;
$timezone = $config->timezone;
$hosts = implode(", ", $config->httpHosts);
$adminTheme = $config->defaultAdminTheme;
$dbHost = $config->dbHost;
$dbName = $config->dbName;
$dbUser = $config->dbUser;
$dbPass = $showPass ? $config->dbPass : '*****';
$dbPort = $config->dbPort;

$prepended = trim($config->prependTemplateFile);
$appended = trim($config->appendTemplateFile);
$prependedTemplateFile = $prepended != '' ? $prepended : $none;
$appendedTemplateFile = $appended != '' ? $appended : $none;

$installPath = getcwd();

$status = [
['Version', $version],
['Admin URL', $adminUrl],
['Advanced mode', $advancedMode],
['Debug mode', $debugMode],
['Timezone', $timezone],
['HTTP hosts', $hosts],
['Admin theme', $adminTheme],
['Prepended template file', $prependedTemplateFile],
['Appended template file', $appendedTemplateFile],
['Database host', $dbHost],
['Database name', $dbName],
['Database user', $dbUser],
['Database password', $dbPass],
['Database port', $dbPort],
['Installation path', $installPath]
];

return $status;
}

/**
* @return array
*/
protected function getWsStatus() {
return array(
array('Version', $this->getApplication()->getVersion()),
array('Documentation', $this->tools->writeLink('https://docs.wireshell.pw', false)),
array('License', 'MIT')
);
}

/**
* @return string
*/
protected function getAdminUrl() {
$admin = \ProcessWire\wire('pages')->get('template=admin');
$url = \ProcessWire\wire('config')->urls->admin;

if (!($admin instanceof \ProcessWire\NullPage) && isset($admin->httpUrl)) {
$url = $admin->httpUrl;
}

/**
* @return string
*/
protected function getAdminUrl() {
$admin = \ProcessWire\wire('pages')->get('template=admin');
$url = \ProcessWire\wire('config')->urls->admin;
return $url;
}

if (!($admin instanceof \ProcessWire\NullPage) && isset($admin->httpUrl)) {
$url = $admin->httpUrl;
}
/**
* wrapper method for the Diagnose PHP submodule from @netcarver
*/
protected function getDiagnosePHP() {
$sub = new DiagnosePhp();
$rows = $sub->GetDiagnostics();
$result = [];

return $url;
foreach ($rows as $row) {
$result[] = [$row['title'], $row['value']];
}

/**
* wrapper method for the Diagnose PHP submodule from @netcarver
*/
protected function getDiagnosePHP() {
$sub = new DiagnosePhp();
$rows = $sub->GetDiagnostics();
$result = [];
return $result;
}

foreach ($rows as $row) {
$result[] = [$row['title'], $row['value']];
}
/**
* wrapper method for the Diagnose Imagehandling submodule from @netcarver & @horst
*/
protected function getDiagnoseImagehandling() {
$sub = new DiagnoseImagehandling();
$rows = $sub->GetDiagnostics();
$result = [];

return $result;
foreach ($rows as $row) {
$result[] = [$row['title'], $row['value']];
}

/**
* wrapper method for the Diagnose Imagehandling submodule from @netcarver & @horst
*/
protected function getDiagnoseImagehandling() {
$sub = new DiagnoseImagehandling();
$rows = $sub->GetDiagnostics();
$result = [];

foreach ($rows as $row) {
$result[] = [$row['title'], $row['value']];
}

return $result;
}
return $result;
}

}

0 comments on commit 81829fe

Please sign in to comment.