Skip to content

Instantly share code, notes, and snippets.

@cukabeka
Created February 18, 2014 21:09
Show Gist options
  • Save cukabeka/9080159 to your computer and use it in GitHub Desktop.
Save cukabeka/9080159 to your computer and use it in GitHub Desktop.
Backup Files
<?php
#http://www.phpbuddy.eu/spl-standard-php-library.html?showall=1
ini_set("max_execution_time", 0);
$verzeichnis = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator( './redaxo' ), true );
$zip = new ZipArchive;
$resource = $zip->open( 'redaxo.zip', ZipArchive::CREATE );
if ($resource === TRUE)
{
foreach ( $verzeichnis as $datei )
{
$zip->addFile( $datei, $datei );
}
}
$zip->close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment