Files
zhamao-framework/src/ZM/Command/NonPharLoadModeOnly.php

21 lines
370 B
PHP
Raw Normal View History

2022-12-17 22:18:50 +08:00
<?php
declare(strict_types=1);
namespace ZM\Command;
trait NonPharLoadModeOnly
{
protected function shouldExecute(): bool
{
if (\Phar::running() === '') {
return true;
}
if (method_exists($this, 'error')) {
$this->error('此命令只能在非 Phar 模式下使用!');
}
return false;
}
}