How to [recursively] Zip a directory in PHP? [duplicate]

Here is a simple function that can compress any file or directory recursively, only needs the zip extension to be loaded. function Zip($source, $destination) { if (!extension_loaded(‘zip’) || !file_exists($source)) { return false; } $zip = new ZipArchive(); if (!$zip->open($destination, ZIPARCHIVE::CREATE)) { return false; } $source = str_replace(‘\\’, “https://stackoverflow.com/”, realpath($source)); if (is_dir($source) === true) { $files … Read more

What is the best project structure for a Python application? [closed]

Doesn’t too much matter. Whatever makes you happy will work. There aren’t a lot of silly rules because Python projects can be simple. /scripts or /bin for that kind of command-line interface stuff /tests for your tests /lib for your C-language libraries /doc for most documentation /apidoc for the Epydoc-generated API docs. And the top-level … Read more