Skip to content

Instantly share code, notes, and snippets.

@RakeshChowdhury
Last active December 21, 2022 10:54
Show Gist options
  • Save RakeshChowdhury/65710ed4949914065c9cfef4d00691df to your computer and use it in GitHub Desktop.
Save RakeshChowdhury/65710ed4949914065c9cfef4d00691df to your computer and use it in GitHub Desktop.
KOD Explorer Installer script
tested on: liveblog365
upload the file above. then navigate.
<?php
// Download
$file_name = "filexplorer.zip";
$kodarchive_url = "https://github.com/kalcaddle/KODExplorer/archive/master.zip";
if (file_put_contents($file_name, file_get_contents($kodarchive_url)))
{
echo "File downloaded successfully\n";
}
else
{
echo "File downloading failed.\n";
}
// assuming file.zip is in the same directory as the executing script.
$file = 'filexplorer.zip';
$path = getcwd();
$unzip = new ZipArchive;
$out = $unzip->open($file_name);
if ($out === TRUE) {
$unzip->extractTo($path);
$unzip->close();
echo 'File unzipped...\n';
} else {
echo 'Error unzipping...\n';
}
// Rename folders
rename("KodExplorer-master","explorer");
echo 'Rename...\n';
// Clean
$status=unlink($file_name);
if($status){
echo "Zip file cleaned successfully...\n";
}else{
echo "Unable to clean zip...!\n";
}
// List
$files = array_diff(scandir($path), array('.', '..'));
foreach($files as $file) {
echo('\n' + $file);
}
// Ok
echo 'Ok...\n';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment