Factory class for generating email transport instances.
array
_buildTransport( string $name )
Finds and builds the instance of the required tranport class.
$name
get( string $name )
Get transport instance.
$name
Cake\Mailer\AbstractTransport
getRegistry( )
Returns the Transport Registry used for creating and using transport instances.
Cake\Mailer\TransportRegistry
setRegistry( Cake\Mailer\TransportRegistry $registry )
Sets the Transport Registry instance used for creating and using transport instances.
Also allows for injecting of a new registry instance.
Cake\Mailer\TransportRegistry
$registry
config( string|array $key , array|null $config = null )
This method can be used to define configuration adapters for an application or read existing configuration.
To change an adapter's configuration at runtime, first drop the adapter and then reconfigure it.
Adapters will not be constructed until the first operation is done.
Assuming that the class' name is Cache
the following scenarios are supported:
Reading config data back:
Cache::config('default');
Setting a cache engine up.
Cache::config('default', $settings);
Injecting a constructed adapter in:
Cache::config('default', $instance);
Configure multiple adapters at once:
Cache::config($arrayOfConfig);
$key
$config
optional null configured( )
Returns an array containing the named configurations
drop( string $config )
Drops a constructed adapter.
If you wish to modify an existing configuration, you should drop it, change configuration and then re-add it.
If the implementing objects supports a $_registry
object the named configuration will also be unloaded from the registry.
$config
dsnClassMap( array $map = null )
Returns or updates the DSN class map for this class.
$map
optional null getConfig( string $key )
Reads existing configuration.
$key
getDsnClassMap( )
Returns the DSN class map for this class.
parseDsn( string $dsn )
Parses a DSN into a valid connection configuration
This method allows setting a DSN using formatting similar to that used by PEAR::DB. The following is an example of its usage:
$dsn = 'mysql://user:pass@localhost/database?'; $config = ConnectionManager::parseDsn($dsn); $dsn = 'Cake\Log\Engine\FileLog://?types=notice,info,debug&file=debug&path=LOGS'; $config = Log::parseDsn($dsn); $dsn = 'smtp://user:secret@localhost:25?timeout=30&client=null&tls=null'; $config = Email::parseDsn($dsn); $dsn = 'file:///?className=\My\Cache\Engine\FileEngine'; $config = Cache::parseDsn($dsn); $dsn = 'File://?prefix=myapp_cake_core_&serialize=true&duration=+2 minutes&path=/tmp/persistent/'; $config = Cache::parseDsn($dsn);
For all classes, the value of scheme
is set as the value of both the className
unless they have been otherwise specified.
Note that querystring arguments are also parsed and set as values in the returned configuration.
$dsn
setConfig( string|array $key , array $config = null )
This method can be used to define configuration adapters for an application.
To change an adapter's configuration at runtime, first drop the adapter and then reconfigure it.
Adapters will not be constructed until the first operation is done.
Assuming that the class' name is Cache
the following scenarios are supported:
Setting a cache engine up.
Cache::setConfig('default', $settings);
Injecting a constructed adapter in:
Cache::setConfig('default', $instance);
Configure multiple adapters at once:
Cache::setConfig($arrayOfConfig);
$key
$config
optional null setDsnClassMap( array $map )
Updates the DSN class map for this class.
$map
protected static array
An array mapping url schemes to fully qualified Transport class names
[ 'debug' => 'Cake\Mailer\Transport\DebugTransport', 'mail' => 'Cake\Mailer\Transport\MailTransport', 'smtp' => 'Cake\Mailer\Transport\SmtpTransport', ]
protected static Cake\Mailer\TransportRegistry
Transport Registry used for creating and using transport instances.
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.8/class-Cake.Mailer.TransportFactory.html