docraptor / docraptor-php Goto Github PK
View Code? Open in Web Editor NEWA native PHP client for the DocRaptor document generation service.
License: MIT License
A native PHP client for the DocRaptor document generation service.
License: MIT License
The code examples make reference to PrinceOptions
but they need to be DocRaptor\PrinceOptions
to resolve correctly.
Hello,
I'm working on setting up Docraptor, and kept getting the following error:
AN ERROR OCCURRED DURING EXECUTION; PLEASE TRY AGAIN LATER.
ADDITIONAL INFORMATION:
DOCRAPTOR\APIEXCEPTION
File:
[...]/vendor/docraptor/docraptor/lib/ApiClient.php:249
Message:
[422] Error connecting to the API (https://docraptor.com//docs)
Eventually I figured out that it wasn't an actual connection error, and discovered that debug mode could output to a file. Once I turned that on, I found the following in the debug response:
[DEBUG] HTTP Response body ~BEGIN~
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>[Javascript Error] ReferenceError: Can't find variable: L</error>
<error>[Javascript Error] document:642</error>
</errors>
~END~
So, it turns out that Docraptor could connect to the API, it was just running into some JS errors on my page. It would be very helpful if these errors were reported in the exception that gets thrown, instead of throwing a generic "error connecting to the API" message.
It's easy for generated clients to return accidentally utf8 encoded data, which ends up corrupting PDF/XLS/XLSX files. Let's add a test to ensure this can never happen.
Here is an example from the other PHP: expectedbehavior/php-docraptor#23
If possile, it should use the PHPUnit
to organize the tests.
If approved, let me do this.
Thanks.
Here is an example from the other PHP: expectedbehavior/php-docraptor#29
I imagine this being helpful with the code we write for examples and any changes we make to the gen'ed code.
ignore_console_messages
, which defaults to true
as of Pipeline 7, is included on every PHP request as false
. This causes console messages to unexpectedly fail documents. My expectation would be that ignore_console_messages
isn't included in the request unless explicitly defined.
As a workaround, ignore_console_messages
can simply be set to true
.
A few of the examples mistakenly write $prince_options
instead of $prince_options
.
Since upgrading to 3.0.0 I'm getting an error:
file_get_contents(): Filename cannot be empty in path\vendor\docraptor\docraptor\lib\DocApi.php on line 395
Changing getRealpath
to getPathname
fixes it. Suspect it might be because we're running PHP on a Windows server running IIS.
Some PHP installations don't have root CAs included, so a default configuration of the PHP package won't work because under the hood curl fails to verify DocRaptor's cert.
This will show up in the apache logs:
SSL certificate problem: unable to get local issuer certificate
Unfortunately the exception that is raised is:
Uncaught exception 'DocRaptor\ApiException' with message 'API call to https://docraptor.com//docs timed out
which is misleading.
We might be able to bundle the necessary certs with the package to solve this.
Laravel 8 requires Guzzle 7 but docraptor doesn't support it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.