Это видео недоступно.
Сожалеем об этом.

Zip files with PHP: Building the Class

Поделиться
HTML-код
  • Опубликовано: 15 мар 2014
  • Want more? Explore the library at www.codecourse...
    Official site
    www.codecourse...
    Twitter
    / teamcodecourse

Комментарии • 13

  • @sweLogan
    @sweLogan 10 лет назад +2

    You should add support for folders, ->add(folder / folder)

  • @hamism9087
    @hamism9087 10 лет назад

    thank you alex for this awesome(as usual) tutorial

  • @Dexter101x
    @Dexter101x 9 лет назад

    Good tutorial, but do you have a way that also backs up subfolders?

  • @LukasLindner
    @LukasLindner 10 лет назад +2

    Thx, nice tutorial ;)
    Could you show how to set a password for the zip-archive, too? ;) And, like Krister Johansson said, a "add-folder"-support? ;)
    Thx ;)

  • @Kapulara
    @Kapulara 9 лет назад

    Luggi Lindner This is currently not possible with PHP, You have to do it trough a command line. Or with a Archiver. :/

  • @ExtraNullByte
    @ExtraNullByte 10 лет назад +1

    instead of unsetting the element from the array wouldn't it be more efficient
    to do all the zipping and checking if file exists within one forloop.
    sample code below \/
    //open zip somewhere here, incase something goes wrong rest wont execute
    foreach($this->_files as $file){
    if(file_exists($file){
    $this->_zip->addFile($file, $file);
    }else{//do nothing}
    } //end foreach
    $this->_zip->close();

    • @mazhartejani
      @mazhartejani 7 лет назад

      that is more simple and efficient, great thumbs up

  • @ArnoldsKtm
    @ArnoldsKtm 10 лет назад

    Nice!

  • @aRoamingDuck
    @aRoamingDuck 7 лет назад

    Its sort of funny. if you run the code over and over again, it will keep creating .zips, where the latest one contains a .zip of the previous zip, and so on. So if you name the file "myZip.zip" and run the code over and over the latest version of "myZip.zip" will contain all the previous copies of "myZip.zip" that you made before it.

    • @aRoamingDuck
      @aRoamingDuck 7 лет назад

      to overcome this you can do
      elseif(preg_match('/.zip$/', $file)){
      unset($this->_files[$index]);
      }
      after the "if(!file_exists($file)){" in the store function.
      This regex will see if the $file ends with .zip and remove it from the array of files to compress

  • @newboit2002
    @newboit2002 10 лет назад

    what's the theme you are using in sublime?

  • @ralmarri12
    @ralmarri12 10 лет назад

    thannnnnnnnnk youuuuuuuuuuuuuuuu