Skip to content

EspoCRM – Open Source CRM Application

Command IO write error method

Yurii171029479d67
diff --git a/application/Espo/Core/Console/IO.php b/application/Espo/Core/Console/IO.php
index b42dc76907..60207fbd30 100644
--- a/application/Espo/Core/Console/IO.php
+++ b/application/Espo/Core/Console/IO.php
@@ -32,6 +32,7 @@ namespace Espo\Core\Console;
use RuntimeException;
use const STDOUT;
+use const STDERR;
use const PHP_EOL;
/**
@@ -45,7 +46,7 @@ class IO
private int $exitStatus = 0;
/**
- * Write a string to output.
+ * Write a string to the output.
*/
public function write(string $string): void
{
@@ -53,13 +54,34 @@ class IO
}
/**
- * Write a string followed by the current line terminator to output.
+ * Write a string followed by the current line terminator to the output.
*/
public function writeLine(string $string): void
{
fwrite(STDOUT, $string . PHP_EOL);
}
+ /**
+ * Write a string to the error output.
+ *
+ * @since 10.0.0
+ * @noinspection PhpUnused
+ */
+ public function writeError(string $string): void
+ {
+ fwrite(STDERR, $string);
+ }
+
+ /**
+ * Write a string followed by the current line terminator to the error output.
+ *
+ * @since 10.0.0
+ */
+ public function writeErrorLine(string $string): void
+ {
+ fwrite(STDERR, $string . PHP_EOL);
+ }
+
/**
* Read a line from input. A string is trimmed.
*/