mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 17:15:36 +08:00
Fix phpstan strict compare problem for STDIN
This commit is contained in:
@@ -197,12 +197,13 @@ class ModuleUnpacker
|
|||||||
$prompt = !is_string($this->module['unpack']['global-config-override']) ? '请根据模块提供者提供的要求进行修改 global.php 中对应的配置项' : $this->module['unpack']['global-config-override'];
|
$prompt = !is_string($this->module['unpack']['global-config-override']) ? '请根据模块提供者提供的要求进行修改 global.php 中对应的配置项' : $this->module['unpack']['global-config-override'];
|
||||||
Console::warning('模块作者要求用户手动修改 global.php 配置文件中的项目:');
|
Console::warning('模块作者要求用户手动修改 global.php 配置文件中的项目:');
|
||||||
Console::warning('*' . $prompt);
|
Console::warning('*' . $prompt);
|
||||||
if (STDIN === false) {
|
echo Console::setColor('请输入修改模式,y(使用vim修改)/e(自行使用其他编辑器修改后确认)/N(默认暂不修改):[y/e/N] ', 'gold');
|
||||||
|
$gets = fgets(STDIN);
|
||||||
|
if ($gets === false) {
|
||||||
Console::warning('检测到终端无法输入,请手动修改 global.php 配置文件中的项目');
|
Console::warning('检测到终端无法输入,请手动修改 global.php 配置文件中的项目');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
echo Console::setColor('请输入修改模式,y(使用vim修改)/e(自行使用其他编辑器修改后确认)/N(默认暂不修改):[y/e/N] ', 'gold');
|
$r = strtolower(trim($gets));
|
||||||
$r = strtolower(trim(fgets(STDIN)));
|
|
||||||
switch ($r) {
|
switch ($r) {
|
||||||
case 'y':
|
case 'y':
|
||||||
system('vim ' . escapeshellarg(DataProvider::getWorkingDir() . '/config/global.php') . ' > `tty`');
|
system('vim ' . escapeshellarg(DataProvider::getWorkingDir() . '/config/global.php') . ' > `tty`');
|
||||||
|
|||||||
Reference in New Issue
Block a user