Exemple #1
0
 protected static function getTransport()
 {
     $config = Config::get("mail");
     if (empty($config->driver) || $config->driver == 'mail') {
         $transport = \Swift_MailTransport::newInstance();
     } elseif ($config->driver == 'sendmail') {
         $transport = Swift_SendmailTransport::newInstance($config->sendmail);
     } elseif ($config->driver == 'smtp') {
         $transport = \Swift_SmtpTransport::newInstance()->setHost($config->host)->setPort($config->port)->setEncryption($config->encryption)->setUsername($config->username)->setPassword($config->password);
     } else {
         throw new \RuntimeException("Invalid transport.");
     }
     return $transport;
 }
Exemple #2
0
| You may use the class loader to load your controllers and models.
| This is useful for keeping all of your classes in the "global" namespace.
|
*/
ClassLoader::addPaths(array(App::getAppRoot() . "/controllers", App::getAppRoot() . "/models"))->register();
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
App::alias(Config::get("app")->aliases);
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application.
| By default we will build a basic log file setup which creates a single
| file for logs.
|
*/
Log::useFile("/tmp/caravel.log");
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
Exemple #3
0
 public static function getDefaultConnection()
 {
     return Config::get('database')->default;
 }