2929namespace OCA \Cloud_Py_API \Service ;
3030
3131use bantu \IniGetWrapper \IniGetWrapper ;
32+ use OC \Archive \TAR ;
3233use OCP \IConfig ;
3334use OCP \App \IAppManager ;
3435
@@ -197,7 +198,7 @@ public function isVideosSupported(): bool {
197198
198199 public function isMuslLinux (): bool {
199200 exec ('ldd --version 2>&1 ' , $ output , $ result_code );
200- if (count ($ output ) > 0 && str_contains ($ output [0 ], 'musl ' )) {
201+ if (count ($ output ) > 0 && strpos ($ output [0 ], 'musl ' ) !== false ) {
201202 return true ;
202203 }
203204 return false ;
@@ -209,11 +210,11 @@ public function isMuslLinux(): bool {
209210 public function getOsArch (): string {
210211 $ arm64_names = ["aarch64 " , "armv8 " , "arm64 " ];
211212 $ machineType = php_uname ('m ' );
212- if (str_contains ($ machineType , 'x86_64 ' )) {
213+ if (strpos ($ machineType , 'x86_64 ' ) !== false ) {
213214 return 'amd64 ' ;
214215 }
215216 foreach ($ arm64_names as $ arm64_name ) {
216- if (str_contains ($ machineType , $ arm64_name )) {
217+ if (strpos ($ machineType , $ arm64_name ) !== false ) {
217218 return 'arm64 ' ;
218219 }
219220 }
@@ -408,12 +409,10 @@ public function unTarGz(array $binariesFolder, string $src_filename): array {
408409 if (isset ($ binariesFolder ['success ' ]) && $ binariesFolder ['success ' ]) {
409410 $ dir = $ binariesFolder ['path ' ] . '/ ' ;
410411 $ src_file = $ dir . $ src_filename ;
411- $ phar = new \PharData ($ src_file );
412- $ extracted = $ phar ->extractTo ($ dir , null , true );
413- $ filename = $ phar ->getFilename ();
412+ $ archive = new TAR ($ src_file );
413+ $ extracted = $ archive ->extract ($ dir );
414414 return [
415415 'extracted ' => $ extracted ,
416- 'filename ' => $ filename
417416 ];
418417 }
419418 return [
0 commit comments