Skip to content

Commit 66e27bc

Browse files
committed
output errors on stderr
1 parent 15e17fc commit 66e27bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

console/controllers/MysqlController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,19 @@ public function actionCreate(
125125
$db = getenv("DATABASE_DSN_DB");
126126
}
127127
if (empty($db)) {
128-
$this->stdout('No database configured, aborting.');
128+
$this->stderr('No database configured, aborting.');
129129
return;
130130
}
131131

132132
// check root user settings
133133
$root = $root ?: getenv("DB_ENV_MYSQL_ROOT_USER");
134134
if (empty($root)) {
135-
$this->stdout('No root user configured, aborting.');
135+
$this->stderr('No root user configured, aborting.');
136136
return;
137137
}
138138
$rootPassword = $rootPassword ?: getenv("DB_ENV_MYSQL_ROOT_PASSWORD");
139139
if (empty($rootPassword)) {
140-
$this->stdout('No root password configured, aborting.');
140+
$this->stderr('No root password configured, aborting.');
141141
return;
142142
}
143143

@@ -146,7 +146,7 @@ public function actionCreate(
146146
$dsn = $dsn ?: getenv("DATABASE_DSN_BASE");
147147

148148
if (empty($user) || empty($pass) || empty($dsn)) {
149-
$this->stdout('Configuration failed, aborting.');
149+
$this->stderr('Configuration failed, aborting.');
150150
return;
151151
}
152152

@@ -166,7 +166,7 @@ function () use ($dsn, $root, $rootPassword) {
166166
}
167167
);
168168
} catch (FailingTooHardException $e) {
169-
$this->stdout("\n\nError: Unable to connect to database '".$e->getMessage()."''");
169+
$this->stderr("\n\nError: Unable to connect to database '".$e->getMessage()."''");
170170
\Yii::$app->end(1);
171171
}
172172
$this->stdout(' [OK]');
@@ -190,7 +190,7 @@ function () use ($dsn, $root, $rootPassword, $pdo, $user, $pass, $db) {
190190
}
191191
);
192192
} catch (FailingTooHardException $e) {
193-
$this->stdout("\n\nError: Unable to setup database '".$e->getMessage()."''");
193+
$this->stderr("\n\nError: Unable to setup database '".$e->getMessage()."''");
194194
\Yii::$app->end(1);
195195
}
196196

0 commit comments

Comments
 (0)