<?php

Autoloader::namespaces(array('Sendersuite' => Bundle::path('sendersuite') . 'lib'));
// Register sendersuite in the IoC container
Laravel\IoC::singleton('sendersuite', function () {
    $confProvider = new \Sendersuite\ConfigurationProvider();
    if (\Laravel\Config::get('sendersuite::config.debugmode')) {
        $apiConnection = new \Sendersuite\EventConnection();
    } else {
        $apiConnection = new \Sendersuite\HttpConnection();
    }
    $ssApi = new \Sendersuite\Api($apiConnection, $confProvider);
    return $ssApi;
});
Example #2
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 #3
0
<?php

Autoloader::map(array('Opauth' => __DIR__ . '/Opauth/Opauth.php'));
Laravel\IoC::singleton('opauth', function () {
    $config = array('Strategy' => array('Facebook' => array('app_id' => 'APP_ID', 'app_secret' => 'APP_SECRET'), 'Twitter' => array('key' => 'APP_KEY', 'secret' => 'APP_SECRET')), 'security_salt' => 'YOURSALTGOESHERE!', 'path' => '/opauth-bundle/public/', 'callback_transport' => 'post', 'callback_url' => '/opauth-bundle/public/done');
    return new Opauth($config);
});
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Laravel\IoC::singleton('HTMLPurifier', function () {
    if (!class_exists('HTMLPurifier_Config', false)) {
        if (Config::get('purifier.preload')) {
            // Load the all of HTML Purifier right now.
            // This increases performance with a slight hit to memory usage.
            require dirname(__FILE__) . '/library/HTMLPurifier.includes.php';
        }
        // Load the HTML Purifier auto loader
        require dirname(__FILE__) . '/library/HTMLPurifier.auto.php';
    }
    // Create a new configuration object
    $config = HTMLPurifier_Config::createDefault();
    if (!Config::get('purifier.finalize')) {
        // Allow configuration to be modified
        $config->autoFinalize = false;
    }
    // Use the same character set as Laravel
    $config->set('Core.Encoding', Config::get('application.encoding'));
    if (is_array($settings = Config::get('purifier.settings'))) {
        // Load the settings
        $config->loadArray($settings);
    }
    // Configure additional options
    $config = HTMLPurifier_Config::create($config);
    // Return the purifier instance
    return new HTMLPurifier($config);
});
Example #5
0
<?php

/**
 * @author Daniel Schniepp < http://daniel-schniepp.com/ >
 * @copyright 2012 daniel-schniepp.com
 * @license http://creativecommons.org/licenses/by-sa/3.0/
 * @package Vimeo Advanced API (Laravel Bundle)
 * @version 1.0 - 2012-08-22
 */
Autoloader::map(array('phpVimeo' => Bundle::path('vimeo-api') . 'vimeo/vimeo.php'));
Laravel\IoC::singleton('vimeo-api', function () {
    $consumer_key = Config::get('vimeo.consumer_key');
    $consumer_secret = Config::get('vimeo.consumer_secret');
    $access_token = Config::get('vimeo.access_token');
    $access_token_secret = Config::get('vimeo.access_token_secret');
    return new phpVimeo($consumer_key, $consumer_secret, $access_token, $access_token_secret);
});
<?php

Autoloader::map(array('stripe-oauth' => Bundle::path('laravel-stripe-oauth-bundle') . 'PHP-StripeOAuth/StripeOAuth.class.php'));
Laravel\IoC::singleton('stripe-oauth', function () {
    $config = array();
    $config['_cID'] = Config::get('stripeoauth._cid', Config::get('stripe-oauth::stripeoauth._cid'));
    $config['secret'] = Config::get('stripeoauth.secret', Config::get('stripe-oauth::stripeoauth.secret'));
    return new FoursquareApi($config['_cID'], $config['secret']);
});
<?php

Autoloader::map(array('Hybrid_Auth' => Bundle::path('hybridauth') . 'hybridauth/Hybrid/Auth.php', 'Hybrid_Endpoint' => Bundle::path('hybridauth') . 'hybridauth/Hybrid/Endpoint.php'));
Laravel\IoC::singleton('hybridauth', function () {
    return new Hybrid_Auth(path('app') . '/config/hybridauth.php');
});
<?php

/**
 * @author Andrew Zappella < http://www.suisseo.ch/ >
 * @copyright 2012 Suisseo SARL
 * @license http://creativecommons.org/licenses/by-sa/3.0/
 * @package Google API PHP Client (Laravel Bundle)
 * @version 0.2.1 - 2013-03-17
 */
const BUNDLE_NAME = 'google-api-php-client';
Autoloader::map(array('Google_Client' => Bundle::path(BUNDLE_NAME) . 'google-api-php-client' . DS . 'src' . DS . 'Google_Client.php'));
// Autoloader::directories(array(Bundle::path(BUNDLE_NAME).'google-api-php-client'.DS.'src'.DS.'contrib'));
Laravel\IoC::singleton('google-api-php-client', function () {
    $bundle_prefix = Bundle::prefix(BUNDLE_NAME);
    $config = array();
    $config['application_name'] = Config::get($bundle_prefix . 'google.application_name');
    $config['oauth2_client_id'] = Config::get($bundle_prefix . 'google.client_id');
    $config['oauth2_client_secret'] = Config::get($bundle_prefix . 'google.client_secret');
    $config['oauth2_redirect_uri'] = Config::get($bundle_prefix . 'google.redirect_uri');
    $config['developer_key'] = Config::get($bundle_prefix . 'google.developer_key');
    $config['use_objects'] = Config::get($bundle_prefix . 'google.use_objects');
    $google = new Google_Client($config);
    $google->setScopes(Config::get($bundle_prefix . 'google.set_scopes'));
    $google->setAccessType(Config::get($bundle_prefix . 'google.access_type'));
    $google->setApprovalPrompt(Config::get($bundle_prefix . 'google.approval_prompt'));
    // autoload Google API services
    $classes = Google::services();
    $mappings = Google::format_mappings($classes);
    Autoloader::map($mappings);
    return $google;
});
<?php

/**
 * @author Tracy Mazelin
 * @copyright 2013 Tracy Mazelin
 * @license apache license 2.0, code is distributed "as is", use at own risk, all rights reserved
 */
Autoloader::map(array('FellowshipOne' => path('app') . 'libraries/FellowshipOne.php'));
Laravel\IoC::singleton('FellowshipOne', function () {
    $settings = Config::get('fellowshipone');
    return new FellowshipOne($settings);
});