Example #1
0
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
/*
 * Setup Propel
 */
if (defined('LARAVEL_ENV')) {
    require app_path() . '/config/propel/config.php';
    if (LARAVEL_ENV == 'local') {
        $con = Propel\Runtime\Propel::getWriteConnection(\Zidisha\User\Map\UserTableMap::DATABASE_NAME);
        Debugbar::addCollector(new DebugBar\DataCollector\PDO\PDOCollector($con->getConnection()));
    }
}
/*
 * Extending auth class with propel
 */
Auth::extend('propel', function ($app) {
    return new \Zidisha\Auth\PropelUserProvider();
});
/**
 * Custom validator class
 */
Validator::resolver(function ($translator, $data, $rules, $messages) {
    return new Zidisha\Form\ZidishaValidator($translator, $data, $rules, $messages);
});
Example #2
0
<?php

/**
 * This file is part of Jarves.
 *
 * (c) Marc J. Schmidt <*****@*****.**>
 *
 *     J.A.R.V.E.S - Just A Rather Very Easy [content management] System.
 *
 *     http://jarves.io
 *
 * To get the full copyright and license information, please view the
 * LICENSE file, that was distributed with this source code.
 */
use Doctrine\Common\Annotations\AnnotationRegistry;
$file = __DIR__ . '/../vendor/autoload.php';
if (!file_exists($file)) {
    throw new RuntimeException('Install dependencies to run test suite.');
}
/** @var $autoload \Composer\Autoload\ClassLoader */
$autoload = (include $file);
AnnotationRegistry::registerLoader(array($autoload, 'loadClass'));
$autoload->set('', realpath(__DIR__ . '/../../../'));
$autoload->set('', realpath(__DIR__ . '/Integration/skeletion/src/'));
Propel\Runtime\Propel::disableInstancePooling();