Skip to content

How switched class ZipArchive? #2133

Open
@chirukinbb

Description

@chirukinbb

Use this lib in Laravel app and doesn't can enabled zip module in php
Code of my controller
`
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\Settings;

class DocumentController extends Controller
{
static $docMap = [
'1. Договор.docx'
];

public function __construct()
{
    Settings::setZipClass(Settings::PCLZIP);
}

public function index(Request $request)
{
    if (is_null($request->input('id'))) return;

    $path = Storage::disk('local')->path('docs/'.self::$docMap[$request->input('id')]);//dd($path);
    $document = IOFactory::load($path);
}

}
`
Needed ZipArchive class, but i want use PhpOffice\PhpWord\Shared\ZipArchive.
When i rewrite setting string from __construct method to index - nothings change
when i wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions