* Autoloader and dependency injection initialization for Swift Mailer. */ if (defined('SWIFT_REQUIRED_LOADED')) { return; } define('SWIFT_REQUIRED_LOADED', true); //Load Swift utility class require dirname(__FILE__) . '/library/classes/Swift.php'; //Start the autoloader Swift::registerAutoload(); //Load the init script to set up dependency injection require dirname(__FILE__) . '/library/swift_init.php'; // Register a mailer in the IoC container Laravel\IoC::singleton('mailer', function () { $transport = Laravel\IoC::resolve('mailer.transport'); return Swift_Mailer::newInstance($transport); }); // Register a transporter in the IoC container Laravel\IoC::register('mailer.transport', function () { /* * USE Mail() Transport */ // return Swift_MailTransport::newInstance(); /* * USE SMTP Transport * * Set SMTP cretentials in /cms/config/settings.php */ $transport = Swift_SmtpTransport::newInstance(Config::get('cms::settings.mail_smtp'), 25)->setUsername(Config::get('cms::settings.mail_username'))->setPassword(Config::get('cms::settings.mail_password')); return $transport; });
<?php /* * This file is part of SwiftMailer. * (c) 2004-2009 Chris Corbyn * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /* * Autoloader and dependency injection initialization for Swift Mailer. */ if (defined('SWIFT_REQUIRED_LOADED')) { return; } define('SWIFT_REQUIRED_LOADED', true); //Load Swift utility class require dirname(__FILE__) . '/library/classes/Swift.php'; //Start the autoloader Swift::registerAutoload(); //Load the init script to set up dependency injection require dirname(__FILE__) . '/library/swift_init.php'; // Register a mailer in the IoC container Laravel\IoC::singleton('mailer', function () { $transport = Laravel\IoC::resolve('mailer.transport'); return Swift_Mailer::newInstance($transport); }); // Register a transporter in the IoC container Laravel\IoC::register('mailer.transport', function () { return Swift_MailTransport::newInstance(); });
* You can also change the $options here * $name = (Auth::user()) ? Auth::user()->name : 'Anonymous'; * $options['upload_dir'] = path('public').'/pictures/'.$name.'/'; * $options['upload_url'] = URL::base().'/pictures/'.$name.'/'; * * However it's better to change the options per controller, like this: * $uploader = IoC::resolve('Uploader'); * $uploader * ->with_option('override_name' , 'MyFixedName') * ->with_option('script_url' , URL::to_route('dbupload')) * ->Start(); */ Laravel\IoC::register('Uploader', function () { $options = Config::get('juploader::settings'); $uploader = isset($options['UploaderClass']) ? $options['UploaderClass'] : 'Uploader\\FileUploadHandler'; $arguments = isset($options['UploaderArguments']) ? $options['UploaderArguments'] : null; $server_options = $options['Server']; return new Uploader\UploadServer($uploader, $arguments, $server_options); }); /** * Assets Management */ Asset::container('juploader')->bundle('juploader')->add('fileupload-ui-css', 'css/jquery.fileupload-ui.css')->add('style', 'css/style.css')->add('jquery-ui', 'js/vendor/jquery.ui.widget.js')->add('tmpl', 'js/extra/tmpl.min.js')->add('load-image', 'js/extra/load-image.min.js')->add('iframe-transport', 'js/jquery.iframe-transport.js')->add('fileupload', 'js/jquery.fileupload.js')->add('fileupload-fp', 'js/jquery.fileupload-fp.js')->add('fileupload-ui', 'js/jquery.fileupload-ui.js')->add('locale', 'js/locale.js'); Asset::container('juploader-gallery')->bundle('juploader')->add('bootstrap-gallery-css', 'css/extra/bootstrap-image-gallery.min.css')->add('bootstrap-gallery', 'js/extra/bootstrap-image-gallery.min.js'); /** * Use this asset only if you are going to * use the library canvas-to-blob * mode details here: https://github.com/blueimp/jQuery-File-Upload/wiki */ Asset::container('juploader-optional')->bundle('juploader')->add('canvas-to-blob', 'js/extra/canvas-to-blob.min.js'); /**