29
29
namespace OCA \Cloud_Py_API \Service ;
30
30
31
31
use bantu \IniGetWrapper \IniGetWrapper ;
32
+ use OC \Archive \TAR ;
32
33
use OCP \IConfig ;
33
34
use OCP \App \IAppManager ;
34
35
@@ -197,7 +198,7 @@ public function isVideosSupported(): bool {
197
198
198
199
public function isMuslLinux (): bool {
199
200
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 ) {
201
202
return true ;
202
203
}
203
204
return false ;
@@ -209,11 +210,11 @@ public function isMuslLinux(): bool {
209
210
public function getOsArch (): string {
210
211
$ arm64_names = ["aarch64 " , "armv8 " , "arm64 " ];
211
212
$ machineType = php_uname ('m ' );
212
- if (str_contains ($ machineType , 'x86_64 ' )) {
213
+ if (strpos ($ machineType , 'x86_64 ' ) !== false ) {
213
214
return 'amd64 ' ;
214
215
}
215
216
foreach ($ arm64_names as $ arm64_name ) {
216
- if (str_contains ($ machineType , $ arm64_name )) {
217
+ if (strpos ($ machineType , $ arm64_name ) !== false ) {
217
218
return 'arm64 ' ;
218
219
}
219
220
}
@@ -408,12 +409,10 @@ public function unTarGz(array $binariesFolder, string $src_filename): array {
408
409
if (isset ($ binariesFolder ['success ' ]) && $ binariesFolder ['success ' ]) {
409
410
$ dir = $ binariesFolder ['path ' ] . '/ ' ;
410
411
$ 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 );
414
414
return [
415
415
'extracted ' => $ extracted ,
416
- 'filename ' => $ filename
417
416
];
418
417
}
419
418
return [
0 commit comments