mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
cs fix
This commit is contained in:
parent
daa87e1350
commit
71d803d36f
@ -493,7 +493,7 @@ class Artifact
|
||||
* Emit all after binary extract callbacks for the specified platform.
|
||||
*
|
||||
* @param null|string $target_path The directory where binary was extracted
|
||||
* @param string $platform The platform string (e.g., 'linux-x86_64')
|
||||
* @param string $platform The platform string (e.g., 'linux-x86_64')
|
||||
*/
|
||||
public function emitAfterBinaryExtract(?string $target_path, string $platform): void
|
||||
{
|
||||
|
||||
@ -570,6 +570,21 @@ class ArtifactExtractor
|
||||
FileSystem::removeDir($temp_dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace path variables.
|
||||
*/
|
||||
protected function replacePathVariables(string $path): string
|
||||
{
|
||||
$replacement = [
|
||||
'{pkg_root_path}' => PKG_ROOT_PATH,
|
||||
'{build_root_path}' => BUILD_ROOT_PATH,
|
||||
'{source_path}' => SOURCE_PATH,
|
||||
'{download_path}' => DOWNLOAD_PATH,
|
||||
'{working_dir}' => WORKING_DIR,
|
||||
];
|
||||
return str_replace(array_keys($replacement), array_values($replacement), $path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Move file or directory, handling cross-device scenarios
|
||||
* Uses rename() if possible, falls back to copy+delete for cross-device moves
|
||||
@ -608,21 +623,6 @@ class ArtifactExtractor
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace path variables.
|
||||
*/
|
||||
protected function replacePathVariables(string $path): string
|
||||
{
|
||||
$replacement = [
|
||||
'{pkg_root_path}' => PKG_ROOT_PATH,
|
||||
'{build_root_path}' => BUILD_ROOT_PATH,
|
||||
'{source_path}' => SOURCE_PATH,
|
||||
'{download_path}' => DOWNLOAD_PATH,
|
||||
'{working_dir}' => WORKING_DIR,
|
||||
];
|
||||
return str_replace(array_keys($replacement), array_values($replacement), $path);
|
||||
}
|
||||
|
||||
private function copyFile(string $source_file, string $target_path): void
|
||||
{
|
||||
FileSystem::createDir(dirname($target_path));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user