Example #1
0
<?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();
});
Example #2
0
|		{
|			return 'Hello World!';
|		});
|
| It's easy to allow URI wildcards using (:num) or (:any):
|
|		Route::put('hello/(:any)', function($name)
|		{
|			return "Welcome, $name.";
|		});
|
*/
$providers = array('facebook/(:any?)', 'twitter/(:any?)', 'google/(:any?)');
Route::get('/', array('uses' => 'home@index'));
Route::get($providers, array('as' => '', function () {
    Laravel\IoC::resolve('opauth');
}));
Route::post('done', function () {
    $response = unserialize(base64_decode($_POST['opauth']));
    echo "<pre>";
    print_r($response);
    echo "</pre>";
});
/*
|--------------------------------------------------------------------------
| Application 404 & 500 Error Handlers
|--------------------------------------------------------------------------
|
| To centralize and simplify 404 handling, Laravel uses an awesome event
| system to retrieve the response. Feel free to modify this function to
| your tastes and the needs of your application.