mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
better description of function
This commit is contained in:
parent
ea56e460d0
commit
27a4d5af54
@ -23,6 +23,6 @@ class imagick extends Extension
|
|||||||
$static .= ' -l:libstdc++.a';
|
$static .= ' -l:libstdc++.a';
|
||||||
$shared = str_replace('-lstdc++', '', $shared);
|
$shared = str_replace('-lstdc++', '', $shared);
|
||||||
}
|
}
|
||||||
return [deduplicate_spaces($static), deduplicate_spaces($shared)];
|
return [clean_spaces($static), clean_spaces($shared)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,9 +98,9 @@ class SPCConfigUtil
|
|||||||
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);
|
$libs = BUILD_LIB_PATH . '/mimalloc.o ' . str_replace(BUILD_LIB_PATH . '/mimalloc.o', '', $libs);
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
'cflags' => deduplicate_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
'cflags' => clean_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
||||||
'ldflags' => deduplicate_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
'ldflags' => clean_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||||
'libs' => deduplicate_spaces(getenv('LIBS') . ' ' . $libs),
|
'libs' => clean_spaces(getenv('LIBS') . ' ' . $libs),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,9 +117,9 @@ class SPCConfigUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'cflags' => deduplicate_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
'cflags' => clean_spaces(getenv('CFLAGS') . ' ' . $cflags),
|
||||||
'ldflags' => deduplicate_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
'ldflags' => clean_spaces(getenv('LDFLAGS') . ' ' . $ldflags),
|
||||||
'libs' => deduplicate_spaces($allLibs),
|
'libs' => clean_spaces($allLibs),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -244,10 +244,12 @@ function get_pack_replace(): array
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $string
|
* Remove duplicate spaces from a string.
|
||||||
* @return string without double spaces
|
*
|
||||||
|
* @param string $string Input string that may contain unnecessary spaces (e.g., " -la -lb").
|
||||||
|
* @return string The trimmed string with only single spaces (e.g., "-la -lb").
|
||||||
*/
|
*/
|
||||||
function deduplicate_spaces($string): string
|
function clean_spaces(string $string): string
|
||||||
{
|
{
|
||||||
return trim(preg_replace('/\s+/', ' ', $string));
|
return trim(preg_replace('/\s+/', ' ', $string));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user