@@ -126,7 +126,7 @@ public function receiveAction($action, $httpVars, $fileVars)
126
126
try {
127
127
$ archive ->addFile (AJXP_MetaStreamWrapper::getRealFSReference ($ fullPath ), $ fileName );
128
128
$ counterCompression ++;
129
- file_put_contents ($ progressCompressionFileName , sprintf ($ messages ["compression.6 " ], round (($ counterCompression / count ($ tabAllFiles )) * 100 , 2 ) . " % " ));
129
+ file_put_contents ($ progressCompressionFileName , sprintf ($ messages ["compression.6 " ], round (($ counterCompression / count ($ tabAllFiles )) * 100 , 0 , PHP_ROUND_HALF_DOWN ) . " % " ));
130
130
} catch (Exception $ e ) {
131
131
unlink ($ tmpArchiveName );
132
132
throw $ e ;
@@ -155,7 +155,7 @@ public function receiveAction($action, $httpVars, $fileVars)
155
155
file_put_contents ($ progressCompressionFileName , "SUCCESS " );
156
156
}
157
157
}
158
- elseif ($ action == "check_compression_status " ) {
158
+ elseif ($ action == "check_compression_status " ) {
159
159
$ archivePath = AJXP_Utils::decodeSecureMagic ($ httpVars ["archive_path " ]);
160
160
$ progressCompression = file_get_contents ($ progressCompressionFileName );
161
161
if ($ progressCompression != "SUCCESS " ) {
@@ -186,7 +186,7 @@ public function receiveAction($action, $httpVars, $fileVars)
186
186
$ counterExtract = 0 ;
187
187
$ currentAllPydioPath = $ currentDirUrl . $ fileArchive ;
188
188
$ pharCurrentAllPydioPath = "phar:// " . AJXP_MetaStreamWrapper::getRealFSReference ($ currentAllPydioPath );
189
- $ pathInfoCurrentAllPydioPath = pathinfo ($ currentAllPydioPath)[ " extension " ] ;
189
+ $ pathInfoCurrentAllPydioPath = pathinfo ($ currentAllPydioPath, PATHINFO_EXTENSION ) ;
190
190
//WE TAKE ONLY TAR, TAR.GZ AND TAR.BZ2 ARCHIVES
191
191
foreach ($ authorizedExtension as $ extension => $ strlenExtension ) {
192
192
if ($ pathInfoCurrentAllPydioPath == $ extension ) {
@@ -239,7 +239,7 @@ public function receiveAction($action, $httpVars, $fileVars)
239
239
$ newNode = new AJXP_Node ($ currentDirUrl . $ onlyFileName . DIRECTORY_SEPARATOR . $ fileNameInArchive );
240
240
AJXP_Controller::applyHook ("node.change " , array (null , $ newNode , false ));
241
241
$ counterExtract ++;
242
- file_put_contents ($ progressExtractFileName , sprintf ($ messages ["compression.12 " ], round (($ counterExtract / $ archive ->count ()) * 100 , 2 ) . " % " ));
242
+ file_put_contents ($ progressExtractFileName , sprintf ($ messages ["compression.12 " ], round (($ counterExtract / $ archive ->count ()) * 100 , 0 , PHP_ROUND_HALF_DOWN ) . " % " ));
243
243
}
244
244
} catch (Exception $ e ) {
245
245
throw new AJXP_Exception ($ e );
0 commit comments