Skip to content

Comments

[WIP] Preview components inside a directory#5

Closed
gorkalaucirica wants to merge 1 commit intomasterfrom
feature/directory-preview
Closed

[WIP] Preview components inside a directory#5
gorkalaucirica wants to merge 1 commit intomasterfrom
feature/directory-preview

Conversation

@gorkalaucirica
Copy link
Contributor

No description provided.

@gorkalaucirica gorkalaucirica force-pushed the feature/directory-preview branch 2 times, most recently from 452668a to e82eb93 Compare June 15, 2017 19:57

declare(strict_types=1);

/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove second license header

*/
class LoadThumbnailsCommand extends Command
{
private const CHROME_BIN = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome";
Copy link
Contributor

Choose a reason for hiding this comment

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

This path is highly coupled with MacOS


protected function configure()
{
$this->setName('lin3s:pattern-library-builder:load-thumbnails');
Copy link
Contributor

Choose a reason for hiding this comment

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

Call setDescription method with proper explanation

}
}

private function takeScreenshot(array $config)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add missing "void" return type

private function takeScreenshot(array $config)
{
$command = sprintf(
'%s --headless --disable-gpu --screenshot=%s http://localhost:8000%s?media=mobile',
Copy link
Contributor

Choose a reason for hiding this comment

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

localhost??

$command = sprintf(
'%s --headless --disable-gpu --screenshot=%s http://localhost:8000%s?media=mobile',
self::CHROME_BIN,
__DIR__ . '/../Resources/public/thumbnails/' . mt_rand() . '.png',
Copy link
Contributor

Choose a reason for hiding this comment

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

This path is hardcoded

array_keys($config['config']['preview_parameters'])[0]
);

exec($command);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can you Symfony Process to maintain better compatibility between different envs

@gorkalaucirica
Copy link
Contributor Author

WIP = Not finished yet

@gorkalaucirica gorkalaucirica force-pushed the feature/directory-preview branch from e82eb93 to 9ecaf1a Compare June 18, 2017 10:15
@gorkalaucirica
Copy link
Contributor Author

gorkalaucirica commented Jul 25, 2017

This feature will be implemented using another approach in #12

@benatespina benatespina deleted the feature/directory-preview branch September 12, 2017 15:23
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