SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard Zaggs's Avatar
    Join Date
    Feb 2005
    Posts
    1,051
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PEAR zip problems

    Hi Guys,

    I am using the PEAR class "Archive_Zip". However, it doesn't seem to be working correctly. It doesn't seem to be zipping the files I requested- but instead creates a corrupt blank zip file.

    Below is the code I am using...also I have attached the PEAR class to this post.

    PHP Code:
    include_once(DIR.'/pear/Zip.php');
                
    $obj = new Archive_Zip(DIR.'/_dt_backups/site-backup-'.time().'.zip');
                
    $files = array(DIR.'/add.php');
                if(
    $obj->create($files)) {
                    
    $this->WriteLog("File backup complete");
                } else {
                    
    $this->WriteLog("File backup error");
                } 
    Any ideas what could be causing this problem?
    Attached Files Attached Files

  2. #2
    SitePoint Wizard Zaggs's Avatar
    Join Date
    Feb 2005
    Posts
    1,051
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also tried the ZipArchive extension and managed to zip the file, but when I goto extract it I get the following error (in vista):

    Windows cannot complete the extraction.
    The Compressed (zipped) Folder 'C:\wamp\www\software\versions\working\2.5.1\_dt_backups\test.zip' is invalid.

  3. #3
    SitePoint Addict
    Join Date
    Nov 2005
    Location
    Moss, Norway.
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are using PHP 5.+ there is a Reflection API that can be used to debug classes. It is one of the many object tools that follows with PHP 5.+ and is much more advanced than the var_dump function.

    If that does not help, the correct place to ask for help is on the pear forum.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •