Библиотека для cis, online, cms1

This commit is contained in:
Фёдор Подлеснов 2016-06-29 18:51:32 +03:00
commit 3c2e614d87
269 changed files with 39854 additions and 0 deletions

41
core/zipfile.php Normal file
View file

@ -0,0 +1,41 @@
<?php
/*.
require_module 'standard';
require_module 'zip';
.*/
/**
* Ðàñøèðåíèå êëàññà ZipArchive ñ âîçìîæíîñòü àðõèâèðîâàíèÿ äèðåêòîðèè
*/
class ZipFile extends ZipArchive
{
private function addDirDo(/*. string.*/ $location, /*. string .*/ $name)
{
assert(is_string($location) && is_string($name));
$name .= '/';
$location .= '/';
// Read all Files in Dir
$dir = opendir($location);
while (($file = readdir($dir)) !== false)
{
if ($file === '.' || $file === '..') continue;
// Rekursiv, If dir: FlxZipArchive::addDir(), else ::File();
$call = (is_dir($file)) ? 'addDir' : 'addFile';
call_user_func(array($this, $call), $location . $file, $name . $file);
}
}
public function addDir(/*. string.*/ $location, /*. string .*/ $name)
{
assert(is_string($location) && is_string($name));
$this->addEmptyDir($name);
$this->addDirDo($location, $name);
}
}
?>