GetSimple Support Forum
Archive plugin creates dual archives - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Archive plugin creates dual archives (/showthread.php?tid=2633)



Archive plugin creates dual archives - mrmut - 2012-01-19

I have a strange problem; each time I use website archive plugin, it created two identical archives. - Screenshot attached.

Any way to cure this?

Thanks!


Archive plugin creates dual archives - mrmut - 2012-01-21

Anyone?

Help would be appreciated, I've looked into the code, but as non-programmer I couldn't decipher what the problem is.


Archive plugin creates dual archives - n00dles101 - 2012-01-21

This should be sorted in the latest SVN.

This only happens on Windows Servers as were using "/" as a directory delimeter.
I've replaced it with DIRECTORY_SEPARATOR in admin\zip.php


Archive plugin creates dual archives - mrmut - 2012-01-21

n00dles101 Wrote:This should be sorted in the latest SVN.

This only happens on Windows Servers as were using "/" as a directory delimeter.
I've replaced it with DIRECTORY_SEPARATOR in admin\zip.php

Thanks for reply!

This sounds strange, as I have problems exactly on linux server cluster, not Window WAMP. I suppose you thought about ISA in regard to Windows Servers?

EDIT START

Ah, I just checked it. Will try it and report back if there will be any problems.
Thanks for Re!


EDIT END
Could you instruct me in short how to implement the change in 3.0? I've tried combining documents, etc (non-programmer), but just got a lot of mess.

Thanks!


Archive plugin creates dual archives - n00dles101 - 2012-01-21

changed the following lines in zip.php

Code:
foreach($iter as $element) {
            /* @var $element SplFileInfo */
            $dir = str_replace($sourcePath, '', $element->getPath()) . '/';
            if ( strstr($dir, $GSADMIN.DIRECTORY_SEPARATOR ) || strstr($dir, 'backups'.DIRECTORY_SEPARATOR )) {
                  #don't archive these folders
                } else if ($element->getFilename() != '..') { // FIX: if added to ignore parent directories
                  if ($element->isDir()) {
                     $archiv->addEmptyDir($dir);
                } elseif ($element->isFile()) {
                    $file         = $element->getPath() .
                                    DIRECTORY_SEPARATOR  . $element->getFilename();
                    $fileInArchiv = $dir . $element->getFilename();
                    // add file to archive
                    $archiv->addFile($file, $fileInArchiv);
                }
              }
        }

dn't think its changed much from 3.0


Mike.


Archive plugin creates dual archives - mrmut - 2012-01-21

n00dles101 Wrote:changed the following lines in zip.php

Code:
foreach($iter as $element) {
            /* @var $element SplFileInfo */
            $dir = str_replace($sourcePath, '', $element->getPath()) . '/';
            if ( strstr($dir, $GSADMIN.DIRECTORY_SEPARATOR ) || strstr($dir, 'backups'.DIRECTORY_SEPARATOR )) {
                  #don't archive these folders
                } else if ($element->getFilename() != '..') { // FIX: if added to ignore parent directories
                  if ($element->isDir()) {
                     $archiv->addEmptyDir($dir);
                } elseif ($element->isFile()) {
                    $file         = $element->getPath() .
                                    DIRECTORY_SEPARATOR  . $element->getFilename();
                    $fileInArchiv = $dir . $element->getFilename();
                    // add file to archive
                    $archiv->addFile($file, $fileInArchiv);
                }
              }
        }

dn't think its changed much from 3.0


Mike.


OK, I've just tested it and it worked.

Have you ever gotten around that double-file loop? It is quite strange, and I routinely get it. The site works perfectly on my local server, and does this on hosting service. I've contacted them, and they think it is some kind of semi-loop in Q.

[Image: misc.php?item=944&download=0&secure_str=7692t3209]


Archive plugin creates dual archives - n00dles101 - 2012-01-22

duplicate archives are created if you double/treble click he create archive button, an archive is created for each click with a slightly different timestamp.

in 3.0 on windows with the above bug, they will also include the unfinished archive running in the background.

we will resolve this by ensuring you can only click once on the button until the archiving is complete...

mike.


Archive plugin creates dual archives - mrmut - 2012-01-22

No, multiple clicks were not an issue.

I've tried with different pointing device, and using a Safari browser on iPad this moment, to be absolutely sure one click was due.

Now, I had not one, but three archives created!

By now, I am pretty sure the internet browser(s) are the culprits! As the archive creation lasts a while, the browser tries reconnecting using the same URL, triggering the event again (or more, depending on the browser). When I clicked create and archive and than force-stopped loading the page, one archive was created.

Is there a way to stop the browser triggering an action again?