original_string: public function add_directory($localname) {
          if ($this->emptyziphack) {
              $this->close();
              $this->open($this->archivepathname, file_archive::OVERWRITE, $this->encoding);
          }
  
          if (!isset($this->za)) {
              return false;
          }
          $localname = trim($localname, '/'). '/';
          $localname = $this->mangle_pathname($localname);
  
          if ($localname === '/') {
              // Sorry - conversion failed badly.
              return false;
          }
  
          if ($localname !== '') {
              if (!$this->za->addEmptyDir($localname)) {
                  return false;
              }
              $this->modified = true;
          }
          return true;
      }
code: public function add_directory($localname) {
          if ($this->emptyziphack) {
              $this->close();
              $this->open($this->archivepathname, file_archive::OVERWRITE, $this->encoding);
          }
  
          if (!isset($this->za)) {
              return false;
          }
          $localname = trim($localname, '/'). '/';
          $localname = $this->mangle_pathname($localname);
  
          if ($localname === '/') {
              // Sorry - conversion failed badly.
              return false;
          }
  
          if ($localname !== '') {
              if (!$this->za->addEmptyDir($localname)) {
                  return false;
              }
              $this->modified = true;
          }
          return true;
      }
code_tokens: public function add_directory ( $ localname ) { if ( $ this -> emptyziphack ) { $ this -> close ( ) ; $ this -> open ( $ this -> archivepathname , file_archive :: OVERWRITE , $ this -> encoding ) ; } if ( ! isset ( $ this -> za ) ) { return false ; } $ localname = trim ( $ localname , '/' ) . '/' ; $ localname = $ this -> mangle_pathname ( $ localname ) ; if ( $ localname === '/' ) { // Sorry - conversion failed badly. return false ; } if ( $ localname !== '' ) { if ( ! $ this -> za -> addEmptyDir ( $ localname ) ) { return false ; } $ this -> modified = true ; } return true ; }
docstring: Add empty directory into archive.
  
  @param string $localname name of file in archive
  @return bool success
docstring_tokens: Add empty directory into archive .