-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #511 from KnpLabs/v2-unstable-wkhtmltopdf-page-opt…
…ions feat(page-options): add page options classes for wkhtmltopdf
- Loading branch information
Showing
44 changed files
with
986 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class Allow implements ExtraOption | ||
{ | ||
public function __construct(private readonly string $path) | ||
{ | ||
} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--allow', $this->path]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class BypassProxyFor implements ExtraOption | ||
{ | ||
public function __construct(private readonly string $value) | ||
{ | ||
} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--bypass-proxy-for', $this->value]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class CacheDir implements ExtraOption | ||
{ | ||
public function __construct(private readonly string $path) | ||
{ | ||
} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--cache-dir', $this->path]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class CheckBoxSvg implements ExtraOption | ||
{ | ||
public function __construct(private readonly string $path) | ||
{ | ||
} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--checkbox-svg', $this->path]; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Backend/WkHtmlToPdf/ExtraOption/CheckboxCheckedSvg.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class CheckboxCheckedSvg implements ExtraOption | ||
{ | ||
public function __construct(private readonly string $path) | ||
{ | ||
} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--checkbox-checked-svg', $this->path]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class Cookie implements ExtraOption | ||
{ | ||
public function __construct(private readonly string $name, private readonly string $value) | ||
{ | ||
} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--cookie', $this->name, $this->value]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class CustomHeader implements ExtraOption | ||
{ | ||
public function __construct(private readonly string $name, private readonly string $value) | ||
{ | ||
} | ||
|
||
public function isRepeatable(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--custom-header', $this->name, $this->value]; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Backend/WkHtmlToPdf/ExtraOption/CustomHeaderPropagation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class CustomHeaderPropagation implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--custom-header-propagation']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class DefaultHeader implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--default-header']; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Backend/WkHtmlToPdf/ExtraOption/DisableExternalLinks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class DisableExternalLinks implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--disable-external-links']; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Backend/WkHtmlToPdf/ExtraOption/DisableInternalLinks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class DisableInternalLinks implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--disable-internal-links']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class DisableJavascript implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--disable-javascript']; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Backend/WkHtmlToPdf/ExtraOption/DisableSmartShrinking.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class DisableSmartShrinking implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--disable-smart-shrinking']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class EnableForms implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--enable-forms']; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Backend/WkHtmlToPdf/ExtraOption/EnableLocalFileAccess.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class EnableLocalFileAccess implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--enable-local-file-access']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
use KNPLabs\Snappy\Backend\WkHtmlToPdf\ExtraOption; | ||
|
||
class EnablePlugins implements ExtraOption | ||
{ | ||
public function isRepeatable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function compile(): array | ||
{ | ||
return ['--enable-plugins']; | ||
} | ||
} |
Oops, something went wrong.