Last active
December 24, 2015 03:29
-
-
Save juizmill/6737354 to your computer and use it in GitHub Desktop.
Exemplo de como recuperar dados de configuração direto do global.php ou local.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Global Configuration Override | |
* | |
* You can use this file for overriding configuration values from modules, etc. | |
* You would place values in here that are agnostic to the environment and not | |
* sensitive to security. | |
* | |
* @NOTE: In practice, this file will typically be INCLUDED in your source | |
* control, so do not include passwords or other sensitive information in this | |
* file. | |
*/ | |
return array( | |
'mail' => array( | |
'name' => 'smtp.gmail.com', #SMTP do servidor de e-mail | |
'host' => 'smtp.gmail.com', #No google só repetir o SMTP | |
'port' => 465, #Porta do servidor de e-mail | |
'connection_class' => 'login', #Diz que será feito uma autenticação para disparar os e-mail | |
'connection_config' => array( | |
'from' => '[email protected]', # DE! | |
'username' => '[email protected]', #E-Mail de autenticação | |
'password' => '12345', #Senha do e-mail para autenticar | |
'ssl' => 'ssl', #Tipo do envio | |
) | |
), | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getServiceConfig() | |
{ | |
return array( | |
'factories' => array( | |
'Contato\Mail\Transport' => function($sm) { | |
$config = $sm->get('Config'); | |
$transport = new SmtpTransport; | |
$options = new SmtpOptions($config['mail']); | |
$transport->setOptions($options); | |
return $transport; | |
}, | |
'Contato\Service\Contato' => function($sm) { | |
return new Service\Contato($sm->get('Contato\Mail\Transport'),$sm->get('View')); | |
} | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment