Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Refactored assets:install command and apply Symfony styles #14235

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

Closed
wants to merge 1 commit into from

Conversation

1ed
Copy link
Contributor

@1ed 1ed commented Apr 6, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Replaces #13057

screenshot from 2015-04-06 17 26 47
screenshot from 2015-04-06 17 26 16
screenshot from 2015-04-09 10 24 59
screenshot from 2015-04-06 17 33 46
screenshot from 2015-04-06 20 14 57

@ogizanagi
Copy link
Contributor

👍 IMO this is way better than your previous proposal. But there is still an issue (raised by @stof : #13057 (comment) ) using the table layout, which doesn't allow to stream the output.
Can't we just use a list ?

However, I don't think streaming the output for this command is an absolute requirement.

@1ed
Copy link
Contributor Author

1ed commented Apr 6, 2015

I was thinking about using a list too, but streaming the output with list is not possible for now either (at least using SymfonyStyle). I tried to steam the output using just ->sucess(), ->error(), ..., but that was really ugly and unclear. I think the indentation provided by the table makes the output much more readable.

And if any exception happens, there won't be any report about the symlinks which have already been created

Exceptions are caught and printed to the user.

@ogizanagi
Copy link
Contributor

As we're currently loosing the paths information, do you think the verbosity level should allow to print it in the bundle column ?

php app/console assets:install --symlink -v

// Trying to install assets as absolute symbolic links

--- --------------------------------------- ----------------------
     Bundle                                  Method / Error
--- --------------------------------------- ----------------------
 ✔︎   FrameworkBundle                         absolute symlink
     -> web/bundles/framework
 ✔︎   SensioDistributionBundle                absolute symlink
     -> web/bundles/sensiodistributions
--- --------------------------------------- ----------------------

BTW, about the list and SymfonyStyle: IMO we do not have to use the SymfonyStyle exclusively, but to respect as much as possible the standards and the console style guide. That doesn't mean we cannot use our own way to print particular informations. Perhaps it will create new standards for use-cases not covered by the current guide.

@1ed
Copy link
Contributor Author

1ed commented Apr 6, 2015

I'm not sure of using UTF-8 characters as they appearance in the console depends on a lot of things.

@@ -11,20 +11,35 @@

namespace Symfony\Bundle\FrameworkBundle\Command;

use Exception;
Copy link
Member

Choose a reason for hiding this comment

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

This one should be removed and a \ added when needed in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabpot done

@sstok
Copy link
Contributor

sstok commented May 16, 2015

How about a progress bar to indicate running? You can show the table after its done (as summary) but having no output may cause users to think its stuck or something.

@fabpot
Copy link
Member

fabpot commented May 16, 2015

This command should be really fast to execute, so I don't think fixing the "not streaming" problem is worth it.

@1ed 1ed force-pushed the assets-install-style branch from df14ee3 to aaf764e Compare May 16, 2015 16:19
@1ed
Copy link
Contributor Author

1ed commented Jun 18, 2015

ping @fabpot

@1ed
Copy link
Contributor Author

1ed commented Jul 22, 2015

@fabpot are there anything else I should do with this?

@fabpot
Copy link
Member

fabpot commented Sep 14, 2015

👍 for merge into 2.8.

@1ed
Copy link
Contributor Author

1ed commented Sep 28, 2015

@javiereguiluz what do you think about this?

}
$this->filesystem->symlink($originDir, $targetDir);
if (!file_exists($targetDir)) {
throw new IOException(sprintf('Symbolic link "%s" is created but appears to be broken.', $targetDir), 0, null, $targetDir);
Copy link
Member

Choose a reason for hiding this comment

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

... is created but ... -> ... was created but ... ?

@javiereguiluz
Copy link
Member

👍 thanks @1ed. Very nice work! Just solve the fabbot issue and we're good to merge :)

@1ed 1ed force-pushed the assets-install-style branch from aaf764e to ea3b3a7 Compare September 28, 2015 20:00
@1ed
Copy link
Contributor Author

1ed commented Sep 28, 2015

Ready. Thank you!

@fabpot
Copy link
Member

fabpot commented Sep 28, 2015

Thank you @1ed.

@fabpot fabpot closed this in 8e1af88 Sep 28, 2015
@fabpot fabpot mentioned this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants