This commit is contained in:
2026-04-26 01:44:36 +02:00
parent cbc2462ea4
commit 72cb5b8d1d
166 changed files with 2712 additions and 135 deletions

View File

@@ -142,12 +142,27 @@ class UpdateRepository
$file_name = 'update.zip';
$path = pathinfo( realpath( $file_name ), PATHINFO_DIRNAME );
$path = substr( $path, 0, strlen( $path ) - 5 );
$path = rtrim( substr( $path, 0, strlen( $path ) - 5 ), '/\\' ) . '/';
$zip = new \ZipArchive;
$res = $zip -> open( $file_name );
if ( $res === TRUE )
{
$zip -> extractTo( $path );
for ( $i = 0; $i < $zip->numFiles; $i++ )
{
$entry = str_replace( '\\', '/', $zip->getNameIndex( $i ) );
if ( substr( $entry, -1 ) === '/' )
{
$dir = $path . $entry;
if ( !is_dir( $dir ) )
mkdir( $dir, 0755, true );
continue;
}
$targetPath = $path . $entry;
$targetDir = dirname( $targetPath );
if ( !is_dir( $targetDir ) )
mkdir( $targetDir, 0755, true );
file_put_contents( $targetPath, $zip->getFromIndex( $i ) );
}
$zip -> close();
unlink( $file_name );
}