Last active
December 21, 2022 10:54
-
-
Save RakeshChowdhury/65710ed4949914065c9cfef4d00691df to your computer and use it in GitHub Desktop.
KOD Explorer Installer script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tested on: liveblog365 | |
upload the file above. then navigate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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