src/Support/Archive.php
/**
	 * Adds a directory to the archive with the specified name.
	 *
	 * @param string $name
	 */
Adds a directory to the archive with the specified name.
@param string $name
Adds a directory to the archive with the specified name . @param string $name
public function createDirectory($name) {
		$name = str_replace('\\', '', $name);
		$fr  = "\x50\x4b\x03\x04";
		$fr .= "\x0a\x00";
		$fr .= "\x00\x00";
		$fr .= "\x00\x00";
		$fr .= "\x00\x00\x00\x00";
		$fr .= pack('v', 0);
		$fr .= pack('v', 0);
		$fr .= pack('v', 0);
		$fr .= pack('v', strlen($name));
		$fr .= pack('v', 0);
		$fr .= $name;
		$fr .= pack('V', 0);
		$fr .= pack('V', 0);
		$fr .= pack('V', 0);
		$this->datasec[] = $fr;
		$new_offset = strlen(implode('', $this->datasec));
		$cdrec  = "\x50\x4b\x01\x02";
		$cdrec .= "\x00\x00";
		$cdrec .= "\x0a\x00";
		$cdrec .= "\x00\x00";
		$cdrec .= "\x00\x00";
		$cdrec .= "\x00\x00\x00\x00";
		$cdrec .= pack('v', 0);
		$cdrec .= pack('v', 0);
		$cdrec .= pack('v', 0);
		$cdrec .= pack('v', strlen($name));
		$cdrec .= pack('v', 0);
		$cdrec .= pack('v', 0);
		$cdrec .= pack('v', 0);
		$cdrec .= pack('v', 0);
		$cdrec .= pack('V', 16);
		$cdrec .= pack('V', $this->oldOffset);
		$this->oldOffset = $new_offset;
		$cdrec .= $name;
		$this->ctrlDir[] = $cdrec;
		$this->dirs[] = $name;
	}
public function createDirectory ( $ name ) { $ name = str_replace ( '\\' , '' , $ name ) ; $ fr = " \x50 \x4b \x03 \x04 " ; $ fr .= " \x0a \x00 " ; $ fr .= " \x00 \x00 " ; $ fr .= " \x00 \x00 " ; $ fr .= " \x00 \x00 \x00 \x00 " ; $ fr .= pack ( 'v' , 0 ) ; $ fr .= pack ( 'v' , 0 ) ; $ fr .= pack ( 'v' , 0 ) ; $ fr .= pack ( 'v' , strlen ( $ name ) ) ; $ fr .= pack ( 'v' , 0 ) ; $ fr .= $ name ; $ fr .= pack ( 'V' , 0 ) ; $ fr .= pack ( 'V' , 0 ) ; $ fr .= pack ( 'V' , 0 ) ; $ this -> datasec [ ] = $ fr ; $ new_offset = strlen ( implode ( '' , $ this -> datasec ) ) ; $ cdrec = " \x50 \x4b \x01 \x02 " ; $ cdrec .= " \x00 \x00 " ; $ cdrec .= " \x0a \x00 " ; $ cdrec .= " \x00 \x00 " ; $ cdrec .= " \x00 \x00 " ; $ cdrec .= " \x00 \x00 \x00 \x00 " ; $ cdrec .= pack ( 'v' , 0 ) ; $ cdrec .= pack ( 'v' , 0 ) ; $ cdrec .= pack ( 'v' , 0 ) ; $ cdrec .= pack ( 'v' , strlen ( $ name ) ) ; $ cdrec .= pack ( 'v' , 0 ) ; $ cdrec .= pack ( 'v' , 0 ) ; $ cdrec .= pack ( 'v' , 0 ) ; $ cdrec .= pack ( 'v' , 0 ) ; $ cdrec .= pack ( 'V' , 16 ) ; $ cdrec .= pack ( 'V' , $ this -> oldOffset ) ; $ this -> oldOffset = $ new_offset ; $ cdrec .= $ name ; $ this -> ctrlDir [ ] = $ cdrec ; $ this -> dirs [ ] = $ name ; }
Adds a directory to the archive with the specified name.
Adds a directory to the archive with the specified name .
// Local file header // Local file descriptor // Data descriptor // Central record header // Central record descriptor