Skip to content

Instantly share code, notes, and snippets.

Created May 17, 2016 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9e2615bfcfd7e16386adb568778d6699 to your computer and use it in GitHub Desktop.
Save anonymous/9e2615bfcfd7e16386adb568778d6699 to your computer and use it in GitHub Desktop.
<?php
// Extraction script for FH2 ZIP folders for BF2 Editor usage
// Place the file into the \mods\fh2 folder and run it via "php extract.php"
// FH V2.51
$objects = array(
"objects_client.zip",
"objects_client_effects.zip",
"objects_client_kits.zip",
"objects_client_soldiers_1.zip",
"objects_client_soldiers_2.zip",
"objects_client_vegitation.zip",
"objects_server.zip",
"objects_statics_client.zip",
"objects_statics_client_bulge.zip",
"objects_statics_client_common.zip",
"objects_statics_client_fr_1.zip",
"objects_statics_client_fr_2.zip",
"objects_statics_client_military.zip",
"objects_statics_client_na.zip",
"objects_statics_client_ru_1.zip",
"objects_statics_client_ru_2.zip",
"objects_statics_client_ru_3.zip",
"objects_statics_client_ru_4.zip",
"objects_statics_client_wrecks.zip",
"objects_statics_server.zip",
"objects_vehicles_client.zip",
"objects_vehicles_client_air_1.zip",
"objects_vehicles_client_air_2.zip",
"objects_vehicles_client_air_3.zip",
"objects_vehicles_client_air_4.zip",
"objects_vehicles_client_air_5.zip",
"objects_vehicles_client_air_6.zip",
"objects_vehicles_client_land_1.zip",
"objects_vehicles_client_land_2.zip",
"objects_vehicles_client_land_de_1.zip",
"objects_vehicles_client_land_de_2.zip",
"objects_vehicles_client_land_de_3.zip",
"objects_vehicles_client_land_de_4.zip",
"objects_vehicles_client_land_de_5.zip",
"objects_vehicles_client_land_de_6.zip",
"objects_vehicles_client_land_de_7.zip",
"bjects_vehicles_client_land_de_8.zip",
"objects_vehicles_client_land_de_9.zip",
"objects_vehicles_client_land_gb_1.zip",
"objects_vehicles_client_land_gb_2.zip",
"objects_vehicles_client_land_gb_3.zip",
"objects_vehicles_client_land_it.zip",
"objects_vehicles_client_land_ru_1.zip",
"objects_vehicles_client_land_ru_2.zip",
"objects_vehicles_client_land_us_1.zip",
"objects_vehicles_client_land_us_2.zip",
"objects_vehicles_client_land_us_3.zip",
"objects_vehicles_server.zip",
"objects_weapons_client.zip",
"objects_weapons_client_handheld_1.zip",
"objects_weapons_client_handheld_2.zip",
"objects_weapons_client_handheld_3.zip",
"objects_weapons_client_handheld_4.zip",
"objects_weapons_server.zip",
);
$common = array(
"common_client.zip",
"common_client_sounds_1.zip",
"common_client_sounds_2.zip",
"common_client_sounds_3.zip",
"common_client_sounds_4.zip",
"common_client_sounds_5.zip",
"common_client_textures.zip"
);
$fonts = array(
"fonts_client.zip"
);
$menu = array(
"menu_client.zip",
"menu_server.zip"
);
$shaders = array(
"shaders_client.zip"
);
$destinations = array(
"common",
"menu",
"objects",
"shaders"
);
$destinations_test = array("one");
$one = array("onefile.zip");
$zip = new ZipArchive;
foreach($destinations as $destination) {
foreach(${$destination} as $source) {
if ($zip->open($source) === TRUE) {
echo "Starting extraction of ".$source." into folder '".$destination."'";
$zip->extractTo($destination);
$zip->close();
echo " Done!\n";
} else {
echo 'failed';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment