mirror of
https://github.com/friendica/friendica
synced 2025-01-24 17:39:47 +00:00
Add cons
This commit is contained in:
parent
127e522ed8
commit
c4f15706ee
2 changed files with 14 additions and 2 deletions
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Asika\SimpleConsole\Console;
|
use Asika\SimpleConsole\Console;
|
||||||
|
use Friendica\Core\Console as CoreConsole;
|
||||||
use Friendica\Core\Logger\Capability\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,13 +26,13 @@ abstract class AbstractConsole extends Console
|
||||||
public const LOG_CHANNEL = LogChannel::CONSOLE;
|
public const LOG_CHANNEL = LogChannel::CONSOLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks, if the Console command was executed outside of`bin/console.php` and prints the correct execution
|
* Checks, if the Console command was executed outside `bin/console.php` and prints the correct execution
|
||||||
*
|
*
|
||||||
* @param string $command the current command
|
* @param string $command the current command
|
||||||
*/
|
*/
|
||||||
protected function checkDeprecated(string $command): void
|
protected function checkDeprecated(string $command): void
|
||||||
{
|
{
|
||||||
if (substr($this->executable, -strlen('bin/console.php')) !== 'bin/console.php') {
|
if (substr($this->executable, -strlen(CoreConsole::getDefaultExecutable())) === CoreConsole::getDefaultExecutable()) {
|
||||||
$this->out(sprintf("'%s' is deprecated and will removed. Please use 'bin/console.php %s' instead", $this->executable, $command));
|
$this->out(sprintf("'%s' is deprecated and will removed. Please use 'bin/console.php %s' instead", $this->executable, $command));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,17 @@ use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
*/
|
*/
|
||||||
class Console extends \Asika\SimpleConsole\Console
|
class Console extends \Asika\SimpleConsole\Console
|
||||||
{
|
{
|
||||||
|
/** @var string The default executable for a console call */
|
||||||
|
private const CONSOLE_EXECUTABLE = 'bin/console.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string The default executable for a console call
|
||||||
|
*/
|
||||||
|
public static function getDefaultExecutable(): string
|
||||||
|
{
|
||||||
|
return self::CONSOLE_EXECUTABLE;
|
||||||
|
}
|
||||||
|
|
||||||
// Disables the default help handling
|
// Disables the default help handling
|
||||||
protected $helpOptions = [];
|
protected $helpOptions = [];
|
||||||
protected array $customHelpOptions = ['h', 'help', '?'];
|
protected array $customHelpOptions = ['h', 'help', '?'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue