88 * License: GNU/GPLv2
99 * @see LICENSE.txt
1010 *
11- * This file: Rar handler (last modified: 2021.07.10 ).
11+ * This file: Rar handler (last modified: 2026.03.17 ).
1212 */
1313
1414namespace phpMussel \Core ;
@@ -44,19 +44,19 @@ class RarHandler extends ArchiveHandler
4444 public function __construct ($ Pointer )
4545 {
4646 /** Rar class requirements guard. */
47- if (!class_exists ('\RarArchive ' ) || !class_exists ('\RarEntry ' )) {
47+ if (!\ class_exists ('\RarArchive ' ) || !\ class_exists ('\RarEntry ' )) {
4848 $ this ->ErrorState = 1 ;
4949 return ;
5050 }
5151
5252 /** Bad pointer guard. */
53- if (!is_readable ($ Pointer )) {
53+ if (!\ is_readable ($ Pointer )) {
5454 $ this ->ErrorState = 2 ;
5555 return ;
5656 }
5757
5858 $ this ->RarObject = \RarArchive::open ($ Pointer );
59- $ this ->ErrorState = is_object ($ this ->RarObject ) ? 0 : 2 ;
59+ $ this ->ErrorState = \ is_object ($ this ->RarObject ) ? 0 : 2 ;
6060 $ this ->PointerSelf = $ Pointer ;
6161 }
6262
@@ -67,7 +67,7 @@ public function __construct($Pointer)
6767 */
6868 public function __destruct ()
6969 {
70- if (is_object ($ this ->RarObject ) && $ this ->ErrorState === 0 ) {
70+ if (\ is_object ($ this ->RarObject ) && $ this ->ErrorState === 0 ) {
7171 $ this ->RarObject ->close ();
7272 }
7373 }
@@ -86,8 +86,8 @@ public function EntryRead(int $Bytes = -1): string
8686 }
8787 $ Output = '' ;
8888 if ($ Bytes > 0 && ($ Stream = $ this ->RarEntry ->getStream ())) {
89- $ Output .= fread ($ Stream , $ this ->RarEntry ->getUnpackedSize ());
90- fclose ($ Stream );
89+ $ Output .= \ fread ($ Stream , $ this ->RarEntry ->getUnpackedSize ());
90+ \ fclose ($ Stream );
9191 }
9292 return $ Output ;
9393 }
@@ -99,7 +99,7 @@ public function EntryRead(int $Bytes = -1): string
9999 */
100100 public function EntryCompressedSize (): int
101101 {
102- return is_object ($ this ->RarEntry ) ? (int )$ this ->RarEntry ->getPackedSize () : 0 ;
102+ return \ is_object ($ this ->RarEntry ) ? (int )$ this ->RarEntry ->getPackedSize () : 0 ;
103103 }
104104
105105 /**
@@ -109,7 +109,7 @@ public function EntryCompressedSize(): int
109109 */
110110 public function EntryActualSize (): int
111111 {
112- return is_object ($ this ->RarEntry ) ? (int )$ this ->RarEntry ->getUnpackedSize () : 0 ;
112+ return \ is_object ($ this ->RarEntry ) ? (int )$ this ->RarEntry ->getUnpackedSize () : 0 ;
113113 }
114114
115115 /**
@@ -119,7 +119,7 @@ public function EntryActualSize(): int
119119 */
120120 public function EntryIsDirectory (): bool
121121 {
122- return is_object ($ this ->RarEntry ) ? $ this ->RarEntry ->isDirectory () : false ;
122+ return \ is_object ($ this ->RarEntry ) ? $ this ->RarEntry ->isDirectory () : false ;
123123 }
124124
125125 /**
@@ -129,7 +129,7 @@ public function EntryIsDirectory(): bool
129129 */
130130 public function EntryIsEncrypted (): bool
131131 {
132- return is_object ($ this ->RarEntry ) ? $ this ->RarEntry ->isEncrypted () : false ;
132+ return \ is_object ($ this ->RarEntry ) ? $ this ->RarEntry ->isEncrypted () : false ;
133133 }
134134
135135 /**
@@ -139,7 +139,7 @@ public function EntryIsEncrypted(): bool
139139 */
140140 public function EntryCRC (): string
141141 {
142- return is_object ($ this ->RarEntry ) ? (string )$ this ->RarEntry ->getCrc () : '' ;
142+ return \ is_object ($ this ->RarEntry ) ? (string )$ this ->RarEntry ->getCrc () : '' ;
143143 }
144144
145145 /**
@@ -150,9 +150,9 @@ public function EntryCRC(): string
150150 */
151151 public function EntryName (): string
152152 {
153- if (is_object ($ this ->RarEntry )) {
153+ if (\ is_object ($ this ->RarEntry )) {
154154 $ Try = $ this ->RarEntry ->getName ();
155- if (is_string ($ Try )) {
155+ if (\ is_string ($ Try )) {
156156 return $ Try ;
157157 }
158158 }
@@ -166,11 +166,11 @@ public function EntryName(): string
166166 */
167167 public function EntryNext (): bool
168168 {
169- if (!is_array ($ this ->RarEntries )) {
169+ if (!\ is_array ($ this ->RarEntries )) {
170170 $ this ->RarEntries = scandir ('rar:// ' . $ this ->PointerSelf );
171171 }
172- if (is_array ($ this ->RarEntries ) && !empty ($ this ->RarEntries )) {
173- $ this ->RarEntry = $ this ->RarObject ->getEntry (array_shift ($ this ->RarEntries ));
172+ if (\ is_array ($ this ->RarEntries ) && !empty ($ this ->RarEntries )) {
173+ $ this ->RarEntry = $ this ->RarObject ->getEntry (\ array_shift ($ this ->RarEntries ));
174174 return true ;
175175 }
176176 return false ;
0 commit comments