JMSDiExtraBundle icon indicating copy to clipboard operation
JMSDiExtraBundle copied to clipboard

Trying to define 2 service with the same name for differents environnements

Open walva opened this issue 10 years ago • 0 comments

Hi there,

In my application, I need a service with 2 différents behaviors according to the current environnement. Here is the interface of my service.

interface FileSystemManagerInterface
{
    public function getFilesystemForContext($context = null);

    public function createPicture($context);

    public function configurePicture(Picture $picture, $context);
}

And I have 2 implementations : first)

@Service("CENSORED.filesystem.manager", environments={"prod"})
class AmazonS3FileSystemManager implements FileSystemManagerInterface

second)

@Service("CENSORED.filesystem.manager", environments={"dev"})
class LocalFileSystemManager implements FileSystemManagerInterface

Unfortunately, in the dev environment I get the AmazonS3FileSystemManager. I think I'm missing something :o

walva avatar Nov 26 '14 10:11 walva