Exemplo n.º 1
0
 public function doMeta()
 {
     $error = false;
     //  Set our metadata
     Metadata::set(Input::except(['user', 'pass', '_token']));
     Metadata::set('theme', 'default');
     //  Check the Stripe API key is valid
     try {
         Stripe::setApiKey(Metadata::item('stripe_key'));
         Stripe\Balance::retrieve();
     } catch (Exception $e) {
         $error = 'That Stripe key doesn’t look valid!';
     }
     //  Create the user
     if (User::whereEmail(Input::get('user'))->exists()) {
         //  We're installing, can't have users already (I think)
         // $error = 'Somebody’s already signed up with that email address!';
     } else {
         User::create(['username' => 'admin', 'name' => 'Administrator', 'level' => User::level('admin'), 'email' => Input::get('user'), 'password' => Input::get('pass')]);
     }
     if ($error === false) {
         return Redirect::to('install/done');
     }
     View::share('error', $error);
     return self::showMeta();
 }
Exemplo n.º 2
0
function get_site_description($fallback = '')
{
    return Metadata::item('site_desc', $fallback);
}
Exemplo n.º 3
0
<?php

/**
 *   Before setting our routes up, we need to make sure
 *   the right admin location is set.
 */
Config::set('admin_location', Metadata::item('admin_location', Config::get('admin_location')));
/**
 *   Here's where routes are normally added in Laravel, but
 *   for Aviate, we separate them out a bit more so the page
 *   doesn't get too crowded. Check out /app/routes.
 */
/**
 *   storefront.php contains all the public site routes that
 *   get powered by the theme.
 */
require_once 'routes/storefront.php';
/**
 *   The admin area isn't powered by the site and is completely
 *   separate from the shop so we'll split that up.
 */
require_once 'routes/admin.php';
/**
 *   The installer needs some routes, let's get them set up.
 */
require_once 'routes/install.php';
Exemplo n.º 4
0
*/
ClassLoader::addDirectories(File::directories(app_path() . '/plugins'));
/*
|--------------------------------------------------------------------------
| Theme functions
|--------------------------------------------------------------------------
|
| Built on top of Laravel is our custom theme functions, we need to make
| sure they're all loaded so there's no errors
|
*/
$functions = array('metadata', 'theme', 'page');
foreach ($functions as $function) {
    require app_path() . '/functions/' . $function . '.php';
}
View::addNamespace('theme', 'public/themes/' . Metadata::item('theme', 'default'));
View::addLocation(get_theme_path('layouts'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a basic log file setup which creates a single file for logs.
|
*/
Log::useFiles(storage_path() . '/logs/laravel.log');
/*
|--------------------------------------------------------------------------
| Application Error Handler
Exemplo n.º 5
0
 public static function current()
 {
     return Metadata::item('theme', 'default');
 }