gpt4 book ai didi

php - ( !'which npm' ) 在 PHP 脚本中是什么意思?

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:56:26 24 4
gpt4 key购买 nike

( !'which npm' ) 在下面的代码中是什么意思?

if ( !'which npm' ) {
die(
'You need to install NPM!' . PHP_EOL
);
}

这是来自 GITHUB 的完整文件的链接:WPBP/generator/bin/wpbp-generator

最佳答案

它检查硬编码字符串是否。这将始终为 false

这个逻辑看起来有点无意义。我怀疑作者更想写:

if (!`which npm`)

backtick operator将命令作为 shell 命令执行,这更有意义。

关于php - ( !'which npm' ) 在 PHP 脚本中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52094786/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com