Respect API transport in the command transport factory

refs #11398
This commit is contained in:
Eric Lippmann 2016-09-01 10:49:08 +02:00
parent 3ccbf37161
commit 440a3f5fdd

View File

@ -65,6 +65,9 @@ class CommandTransport implements CommandTransportInterface
case RemoteCommandFile::TRANSPORT: case RemoteCommandFile::TRANSPORT:
$transport = new RemoteCommandFile(); $transport = new RemoteCommandFile();
break; break;
case ApiCommandTransport::TRANSPORT:
$transport = new ApiCommandTransport();
break;
case LocalCommandFile::TRANSPORT: case LocalCommandFile::TRANSPORT:
case '': // Casting null to string is the empty string case '': // Casting null to string is the empty string
$transport = new LocalCommandFile(); $transport = new LocalCommandFile();
@ -74,12 +77,13 @@ class CommandTransport implements CommandTransportInterface
mt( mt(
'monitoring', 'monitoring',
'Cannot create command transport "%s". Invalid transport' 'Cannot create command transport "%s". Invalid transport'
. ' defined in "%s". Use one of "%s" or "%s".' . ' defined in "%s". Use one of "%s", "%s" or "%s".'
), ),
$config->transport, $config->transport,
static::getConfig()->getConfigFile(), static::getConfig()->getConfigFile(),
LocalCommandFile::TRANSPORT, LocalCommandFile::TRANSPORT,
RemoteCommandFile::TRANSPORT RemoteCommandFile::TRANSPORT,
ApiCommandTransport::TRANSPORT
); );
} }