Browse Source

directory iterator wip

master
Fred Tempez 3 months ago
parent
commit
6f42bb480f
  1. 20
      core/module/theme/theme.php

20
core/module/theme/theme.php

@ -958,17 +958,23 @@ class theme extends common {
if ($zip->open(self::TEMP_DIR . $zipFilename, ZipArchive::CREATE | ZipArchive::OVERWRITE ) === TRUE) {
switch ($modele) {
case 'admin':
$zip->addFile(self::DATA_DIR.'admin.json',self::DATA_DIR.'admin.json');
$zip->addFile(self::DATA_DIR.'admin.css',self::DATA_DIR.'admin.css');
$zip->addFile(self::DATA_DIR.'admin.json');
$zip->addFile(self::DATA_DIR.'admin.css');
// Ajoute les fontes
$zip->addEmptyDir(self::DATA_DIR .'fonts');
$pathdir = self::DATA_DIR .'fonts';
$dir = opendir(self::DATA_DIR .'fonts');
while($file = readdir($dir)) {
if(is_file($pathdir.$file)) {
$zip -> addFile($pathdir.$file, $file);
$path = realpath('site/data/fonts');
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $fileName)
{
echo $fileName;
//var_dump($fileName !== $path . '/..' );
echo "<p>";
if ($fileName !== $path . '/.' || $fileName !== $path . '/..') {
$zip->addFile($fileName);
//echo $fileName;
//echo '<p>';
}
}
die();
break;
case 'theme':
$zip->addFile(self::DATA_DIR.'theme.json',self::DATA_DIR.'theme.json');

Loading…
Cancel
Save