Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use the original service ID instead of its alias #25

Merged
merged 1 commit into from

3 participants

@elnur

mailer is just an alias and an app-specific service can use this name instead. To avoid collisions, use the original swiftmailer.mailer service ID.

@elnur

@fabpot, ping.

@fabpot
Owner

I don't see the point. The mailer service/alias is declared by this bundle, so it makes sense to use it.

@elnur

The point is that I want to use the mailer ID for my own mailer service that is built on top of Swiftmailer. It all works great — except this command because it relies on the mailer ID.

Why depend on an alias instead of the original service name? Is there a reason I don't see yet?

@elnur

So, @fabpot, what do you think?

@fabpot fabpot referenced this pull request from a commit
@fabpot fabpot merged branch elnur/stop-using-alias (PR #25)
This PR was merged into the 2.0 branch.

Commits
-------

29dbd93 Use the original service ID instead of its alias.

Discussion
----------

Use the original service ID instead of its alias

`mailer` is just an alias and an app-specific service can use this name instead. To avoid collisions, use the original `swiftmailer.mailer` service ID.

---------------------------------------------------------------------------

by elnur at 2012-10-11T09:58:46Z

@fabpot, ping.

---------------------------------------------------------------------------

by fabpot at 2012-10-11T12:18:49Z

I don't see the point. The mailer service/alias is declared by this bundle, so it makes sense to use it.

---------------------------------------------------------------------------

by elnur at 2012-10-11T13:00:59Z

The point is that I want to use the `mailer` ID for my own mailer service that is built on top of Swiftmailer. It all works great — except this command because it relies on the `mailer` ID.

Why depend on an alias instead of the original service name? Is there a reason I don't see yet?

---------------------------------------------------------------------------

by elnur at 2012-10-16T06:58:21Z

So, @fabpot, what do you think?
a7a0152
@fabpot fabpot merged commit 29dbd93 into symfony:2.0
@fabpot fabpot referenced this pull request from a commit
@fabpot fabpot Revert "merged branch elnur/stop-using-alias (PR #25)"
This reverts commit a7a0152, reversing
changes made to 5f1b50d.
8d7a554
@fabpot fabpot referenced this pull request from a commit
@fabpot fabpot Merge branch '2.0'
* 2.0:
  Revert "merged branch elnur/stop-using-alias (PR #25)"
2393ba6
@elnur

Could you please tell me why did you revert this PR?

Also, I came up with an additional argument against using the alias: a 3rd party bundle should not reserve for itself such a common name without a prefix. A lot of developers might want to use such a name for their own service.

Actually, the bundle itself isn't reserving it because I can override an alias with an ID of my own service, but the command stops working in this case. So, the only problem is the command.

@stof
Collaborator

@elnur It has been reverted because it was simply broken: 11b9117#commitcomment-2004041

@elnur

Can we just make the swiftmailer.mailer service public then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 6, 2012
  1. @elnur
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  Command/SendEmailCommand.php
View
2  Command/SendEmailCommand.php
@@ -49,7 +49,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $mailer = $this->getContainer()->get('mailer');
+ $mailer = $this->getContainer()->get('swiftmailer.mailer');
$transport = $mailer->getTransport();
if ($transport instanceof \Swift_Transport_SpoolTransport) {
Something went wrong with that request. Please try again.