mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-22 00:05:37 +08:00
cs fix
This commit is contained in:
@@ -570,6 +570,21 @@ class ArtifactExtractor
|
|||||||
FileSystem::removeDir($temp_dir);
|
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
|
* Move file or directory, handling cross-device scenarios
|
||||||
* Uses rename() if possible, falls back to copy+delete for cross-device moves
|
* 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
|
private function copyFile(string $source_file, string $target_path): void
|
||||||
{
|
{
|
||||||
FileSystem::createDir(dirname($target_path));
|
FileSystem::createDir(dirname($target_path));
|
||||||
|
|||||||
Reference in New Issue
Block a user