Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip binary check #324

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ Configure::write('CakePdf', [
* "WKHTMLTOPDF didn't return any data"
*/
// 'binary' => 'C:\\Progra~1\\wkhtmltopdf\\bin\\wkhtmltopdf.exe',

/**
* Skip the binary execution checking for many Linux servers when set to `true`.
* Default value is `false`, which mean we need to check for security reason.
* It has been used when your Linux server cannot run directly the `/usr/bin/wkhtmltopdf`
* so, you need to install another package called `xvfb` to support "X server".
*/
//'skipCheckingExecutableBinary' => false,
//'binary' => '/usr/bin/xvfb-run /usr/bin/wkhtmltopdf'
],
]);
```
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "friendsofcake/cakepdf",
"name": "kongka/cakepdf",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those things should be reverted though then, or make a fresh branch with only relevant changes.

"type": "cakephp-plugin",
"description": "CakePHP plugin for creating and/or rendering Pdfs, several Pdf engines supported.",
"homepage": "http://github.com/friendsofcake/CakePdf",
"homepage": "http://github.com/kongka/CakePdf",
"license": "MIT",
"require": {
"cakephp/cakephp": "^4.0"
Expand Down
4 changes: 4 additions & 0 deletions src/Pdf/Engine/WkHtmlToPdfEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@
public function getBinaryPath(): string
{
$binary = $this->getConfig('binary', $this->_binary);

Check failure on line 216 in src/Pdf/Engine/WkHtmlToPdfEngine.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Whitespace found at end of line
if ($this->getConfig('skipCheckingExecutableBinary', false)) {
return $binary;

Check warning on line 218 in src/Pdf/Engine/WkHtmlToPdfEngine.php

View check run for this annotation

Codecov / codecov/patch

src/Pdf/Engine/WkHtmlToPdfEngine.php#L218

Added line #L218 was not covered by tests
}

/** @psalm-suppress ForbiddenCode */
if (
Expand Down
Loading