mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-10-11 13:24:28 +02:00
Update README
This commit is contained in:
@@ -168,8 +168,7 @@ abstract class ZipAbstractEntry implements ZipEntry
|
||||
if (0x0000 > $length || $length > 0xffff) {
|
||||
throw new ZipException('Illegal zip entry name parameter');
|
||||
}
|
||||
$encoding = mb_detect_encoding($this->name, "ASCII, UTF-8", true);
|
||||
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, $encoding === 'UTF-8');
|
||||
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, true);
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
@@ -792,10 +791,7 @@ abstract class ZipAbstractEntry implements ZipEntry
|
||||
throw new ZipException("Comment too long");
|
||||
}
|
||||
}
|
||||
$encoding = mb_detect_encoding($this->name, "ASCII, UTF-8", true);
|
||||
if ($encoding === 'UTF-8') {
|
||||
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, true);
|
||||
}
|
||||
$this->setGeneralPurposeBitFlag(self::GPBF_UTF8, true);
|
||||
$this->comment = $comment;
|
||||
return $this;
|
||||
}
|
||||
@@ -853,7 +849,7 @@ abstract class ZipAbstractEntry implements ZipEntry
|
||||
public function setPassword($password, $encryptionMethod = null)
|
||||
{
|
||||
$this->password = $password;
|
||||
if ($encryptionMethod !== null) {
|
||||
if (null !== $encryptionMethod) {
|
||||
$this->setEncryptionMethod($encryptionMethod);
|
||||
}
|
||||
$this->setEncrypted(!empty($this->password));
|
||||
|
@@ -240,7 +240,7 @@ abstract class ZipNewEntry extends ZipAbstractEntry
|
||||
fwrite($outputStream, str_repeat(chr(0), $padding));
|
||||
}
|
||||
|
||||
if ($entryContent !== null) {
|
||||
if (null !== $entryContent) {
|
||||
fwrite($outputStream, $entryContent);
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ class ZipNewStreamEntry extends ZipNewEntry
|
||||
*/
|
||||
function __destruct()
|
||||
{
|
||||
if ($this->stream !== null) {
|
||||
if (null !== $this->stream) {
|
||||
fclose($this->stream);
|
||||
$this->stream = null;
|
||||
}
|
||||
|
@@ -118,7 +118,7 @@ class ZipReadEntry extends ZipAbstractEntry
|
||||
*/
|
||||
public function getEntryContent()
|
||||
{
|
||||
if ($this->entryContent === null) {
|
||||
if (null === $this->entryContent) {
|
||||
if ($this->isDirectory()) {
|
||||
$this->entryContent = null;
|
||||
return $this->entryContent;
|
||||
@@ -319,7 +319,7 @@ class ZipReadEntry extends ZipAbstractEntry
|
||||
|
||||
function __destruct()
|
||||
{
|
||||
if ($this->entryContent !== null && is_resource($this->entryContent)) {
|
||||
if (null !== $this->entryContent && is_resource($this->entryContent)) {
|
||||
fclose($this->entryContent);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user