Skip to content

Conversation

@Pierstoval
Copy link
Contributor

@Pierstoval Pierstoval commented Jul 6, 2018

My problem is that Panthère doesn't work on Alpine (because on Alpine we should either use the driver coming from the repository, or recompile it manually).

For this, it could be nice to tell Alpine users to use either the package or to recompile it instead of using Panthère's provided binary. And in general, to get the latest version, it's better to propose them to download the package in another way, for them to be sure 😅.

For now, an env var is the best solution to use another binary, to me.

WDYT?

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

Can you also document this environment variable in the README please?

public function __construct(?string $chromeDriverBinary = null, ?array $arguments = null, array $options = [])
{
$this->process = new Process([$chromeDriverBinary ?? $this->findChromeDriverBinary()], null, null, null, null);
$this->process = new Process([$chromeDriverBinary ?: $this->findChromeDriverBinary()], null, null, null, null);
Copy link
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To avoid $chromeDriverBinary be an empty string 😄

Copy link
Member

Choose a reason for hiding this comment

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

How can it be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With a simple developer mistake, I know I might be paranoid, but if you think I should revert this, feel free to ask, and I will

Copy link
Member

Choose a reason for hiding this comment

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

No it's ok! Can you just document this new env var in the README file please?


private function findChromeDriverBinary(): string
{
if (false !== $binary = \getenv('PANTHERE_CHROME_DRIVER_BINARY')) {
Copy link
Member

Choose a reason for hiding this comment

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

we use $_ENV in other places (getenv isn't thread safe).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@dunglas dunglas merged commit f6f88ba into symfony:master Jul 12, 2018
@dunglas
Copy link
Member

dunglas commented Jul 12, 2018

Thanks @Pierstoval

@Pierstoval Pierstoval deleted the chrome_driver_env branch July 12, 2018 09:08
dunglas pushed a commit that referenced this pull request Dec 28, 2020
* Allow using an env var to determine chrome driver binary

* Added small documentation to use the PANTHERE_CHROME_DRIVER_BINARY env var
nicolas-grekas pushed a commit that referenced this pull request Jan 18, 2021
* Allow using an env var to determine chrome driver binary

* Added small documentation to use the PANTHERE_CHROME_DRIVER_BINARY env var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants