Potentially use whck from bin/ folder for symlinks to existing installs outside of $PATH (from PHP PoV)
This commit is contained in:
parent
4cffbb64b3
commit
eb67748679
|
@ -0,0 +1,2 @@
|
||||||
|
*
|
||||||
|
!.gitignore
|
|
@ -97,9 +97,11 @@ function verify_claim(string $payload, string $claim, string $id, string $valida
|
||||||
function find_whck() {
|
function find_whck() {
|
||||||
// BUG: https://bugs.php.net/bug.php?id=77782
|
// BUG: https://bugs.php.net/bug.php?id=77782
|
||||||
// $_ENV['whck'] and getenv("whck") are empty, but getenv()["whck"] works!
|
// $_ENV['whck'] and getenv("whck") are empty, but getenv()["whck"] works!
|
||||||
|
// NOTE: We use is_file not file_exists() because there may be a whck/ folder
|
||||||
|
// In that case, we check for bin/whck
|
||||||
return isset(getenv()['WHCK']) ? getenv()['WHCK'] // from $ENV
|
return isset(getenv()['WHCK']) ? getenv()['WHCK'] // from $ENV
|
||||||
: (file_exists('whck') ? './whck' // from current directory
|
: (is_file('whck') ? './whck' // from current directory
|
||||||
: 'whck');
|
: (is_file('bin/whck') ? 'bin/whck' : 'whck'));
|
||||||
}
|
}
|
||||||
|
|
||||||
//enum Validator {
|
//enum Validator {
|
||||||
|
|
Loading…
Reference in New Issue