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

feat(page-options): add page options classes for wkhtmltopdf #511

Merged
Merged
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
24 changes: 24 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/Allow.php
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];
}
}
24 changes: 24 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/BypassProxyFor.php
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];
}
}
24 changes: 24 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/CacheDir.php
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];
}
}
24 changes: 24 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/CheckBoxSvg.php
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 src/Backend/WkHtmlToPdf/ExtraOption/CheckboxCheckedSvg.php
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];
}
}
24 changes: 24 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/Cookie.php
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];
}
}
24 changes: 24 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/CustomHeader.php
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 src/Backend/WkHtmlToPdf/ExtraOption/CustomHeaderPropagation.php
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'];
}
}
20 changes: 20 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/DefaultHeader.php
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 src/Backend/WkHtmlToPdf/ExtraOption/DisableExternalLinks.php
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 src/Backend/WkHtmlToPdf/ExtraOption/DisableInternalLinks.php
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'];
}
}
20 changes: 20 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/DisableJavascript.php
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 src/Backend/WkHtmlToPdf/ExtraOption/DisableSmartShrinking.php
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'];
}
}
20 changes: 20 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/EnableForms.php
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 src/Backend/WkHtmlToPdf/ExtraOption/EnableLocalFileAccess.php
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'];
}
}
20 changes: 20 additions & 0 deletions src/Backend/WkHtmlToPdf/ExtraOption/EnablePlugins.php
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'];
}
}
Loading
Loading