mirror of
https://github.com/php-win-ext/php-sdk-binary-tools.git
synced 2026-04-25 09:48:07 +02:00
refactor dependency dir recognition
This commit is contained in:
@@ -296,10 +296,26 @@ class Config
|
|||||||
|
|
||||||
public static function getDepsLocalPath() : ?string
|
public static function getDepsLocalPath() : ?string
|
||||||
{/*{{{*/
|
{/*{{{*/
|
||||||
|
if (NULL == self::$depsLocalPath) {
|
||||||
|
if (file_exists("Makefile")) {
|
||||||
|
$s = file_get_contents("Makefile");
|
||||||
|
|
||||||
|
if (preg_match(",PHP_BUILD=(.+),", $s, $m)) {
|
||||||
|
if (isset($m[1]) && is_dir($m[1])) {
|
||||||
|
self::setDepsLocalPath(realpath($m[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL == self::$depsLocalPath) {
|
if (NULL == self::$depsLocalPath) {
|
||||||
if (file_exists("../deps")) {
|
if (file_exists("../deps")) {
|
||||||
self::setDepsLocalPath(realpath("../deps"));
|
self::setDepsLocalPath(realpath("../deps"));
|
||||||
} else if (file_exists("main/php_version.h")) {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NULL == self::$depsLocalPath) {
|
||||||
|
if (file_exists("main/php_version.h")) {
|
||||||
/* Deps dir might not exist. */
|
/* Deps dir might not exist. */
|
||||||
self::setDepsLocalPath(realpath("..") . DIRECTORY_SEPARATOR . "deps");
|
self::setDepsLocalPath(realpath("..") . DIRECTORY_SEPARATOR . "deps");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user