Tools om het web vast te leggen en te converteren
GrabzIt is een online community

Upgraden naar v3.4.5 - fouten

Twee kwesties:

(1) When installing via Composer the folder structure is very different and is missing many subfolders such as "ajax", "css", etc. Are these not needed when using Grabzit only from the server side (php)?

(2) After downloading the php client I notice the classes are named differently (previously I had "require_once 'vendor/GrabzIt/lib/GrabzItClient.klasse.php';" but now it's "require_once 'vendor/GrabzIt/lib/GrabzItClient.php';"). However, when I try to generate a PDF using this code:

// Create the GrabzItClient class
$grabzIt = new GrabzItClient(GRABZIT_APP_KEY, GRABZIT_APP_SECRET);
$pdfOptions = new GrabzItPDFOptions();

I get an error message:

[17-Jan-2021 11:12:26 America/Toronto] PHP Fatal error: Cannot declare class GrabzIt\GrabzItClient, because the name is already in use in /Users/Ross/Dropbox/htdocs/wonderfest_mamp_pro/private/contest/include/vendor/GrabzIt/lib/GrabzItClient.php on line 11

I really want to use v3.4.5 but this is blocking my development.

Gevraagd door Ross Waddell op 17 januari 2021

It sounds like you are using the legacy version of the PHP  library we moved to using namespaces etc about two and a half years ago. The 3.4.5 legacy version is available on the download page for a manual download.

The legacy version will not be made available on composer as it is only being kept for backwards compatibility. The ajax and css folders are not included as they are part of the demo application and not the library.

If you want to move to the latest version the examples in the PHP-documentatie should help the changes are relatively minor.





Beantwoord door GrabzIt Support op 17 januari 2021

I installed via Composer but when I go to generate my PDF I get a new error:


// Create the GrabzItClient class
$grabzIt = new \GrabzIt\GrabzItClient(GRABZIT_APP_KEY, GRABZIT_APP_SECRET);
$pdfOptions = new \GrabzIt\GrabzItBaseOptions();



[17-Jan-2021 13:10:49 America/Toronto] PHP Fatal error: Uncaught Error: Call to undefined method GrabzIt\GrabzItBaseOptions::setPageSize() in /Users/Ross/Dropbox/htdocs/wonderfest_mamp_pro/private/contest/include/createPDF.php:120


Answered by Ross Waddell on the 17th of January 2021

You have initialized a GrabzItBaseOptions instead of GrabzItPDFOptions

Beantwoord door GrabzIt Support op 17 januari 2021