public function addEmptyDir($directoryPath, $options = NULL) {
    if ($this->isFinalized) {
      return false;
    }
    $defaultOptions = array(
    		'timestamp' => NULL,
    		'comment' => NULL,
    );
    if (is_null($options)) {
    	$options = array();
    }
    $options = array_merge($defaultOptions, $options);

    $directoryPath = self::normalizeFilePath($directoryPath) . '/';

    if (strlen($directoryPath) > 0) {
      $gpFlags = 0x0000;
      $gzMethod = COMPR::STORE; // Compression type 0 = stored

      list($gpFlags, $lfhLength) = $this->beginFile($directoryPath, True, $options['comment'], $options['timestamp'], $gpFlags, $gzMethod);
      // build cdRec
      $this->cdRec[] = $this->buildCentralDirectoryHeader($directoryPath, $options['timestamp'], $gpFlags, $gzMethod,
          Count64::construct(0, !$this->zip64), Count64::construct(0, !$this->zip64), 0, $this->extFileAttrDir, True);

      // calc offset
      $this->offset->add($lfhLength);

      return true;
    }
    return false;
  }
public function addEmptyDir($directoryPath, $options = NULL) {
    if ($this->isFinalized) {
      return false;
    }
    $defaultOptions = array(
    		'timestamp' => NULL,
    		'comment' => NULL,
    );
    if (is_null($options)) {
    	$options = array();
    }
    $options = array_merge($defaultOptions, $options);

    $directoryPath = self::normalizeFilePath($directoryPath) . '/';

    if (strlen($directoryPath) > 0) {
      $gpFlags = 0x0000;
      $gzMethod = COMPR::STORE; // Compression type 0 = stored

      list($gpFlags, $lfhLength) = $this->beginFile($directoryPath, True, $options['comment'], $options['timestamp'], $gpFlags, $gzMethod);
      // build cdRec
      $this->cdRec[] = $this->buildCentralDirectoryHeader($directoryPath, $options['timestamp'], $gpFlags, $gzMethod,
          Count64::construct(0, !$this->zip64), Count64::construct(0, !$this->zip64), 0, $this->extFileAttrDir, True);

      // calc offset
      $this->offset->add($lfhLength);

      return true;
    }
    return false;
  }
public function addEmptyDir ( $ directoryPath , $ options = NULL ) { if ( $ this -> isFinalized ) { return false ; } $ defaultOptions = array ( 'timestamp' => NULL , 'comment' => NULL , ) ; if ( is_null ( $ options ) ) { $ options = array ( ) ; } $ options = array_merge ( $ defaultOptions , $ options ) ; $ directoryPath = self :: normalizeFilePath ( $ directoryPath ) . '/' ; if ( strlen ( $ directoryPath ) > 0 ) { $ gpFlags = 0x0000 ; $ gzMethod = COMPR :: STORE ; // Compression type 0 = stored list ( $ gpFlags , $ lfhLength ) = $ this -> beginFile ( $ directoryPath , True , $ options [ 'comment' ] , $ options [ 'timestamp' ] , $ gpFlags , $ gzMethod ) ; // build cdRec $ this -> cdRec [ ] = $ this -> buildCentralDirectoryHeader ( $ directoryPath , $ options [ 'timestamp' ] , $ gpFlags , $ gzMethod , Count64 :: construct ( 0 , ! $ this -> zip64 ) , Count64 :: construct ( 0 , ! $ this -> zip64 ) , 0 , $ this -> extFileAttrDir , True ) ; // calc offset $ this -> offset -> add ( $ lfhLength ) ; return true ; } return false ; }
Add an empty directory entry to the zip archive.

@param string $directoryPath  Directory Path and name to be added to the archive.
@param array $options      Optional, additional options
Valid options are:
* int timestamp: timestamp for the file (default: current time)
* string comment: comment to be added for this file (default: none)
@return bool $success
Add an empty directory entry to the zip archive .