Skip to content

Commit

Permalink
Updates and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Nov 19, 2014
1 parent c491a5e commit 75ad28e
Show file tree
Hide file tree
Showing 38 changed files with 272 additions and 635 deletions.
18 changes: 1 addition & 17 deletions app/BootstrapCMSServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public function register()
$this->registerPostRepository();

$this->registerCommandSubscriber();
$this->registerCoreSubscriber();
$this->registerNavigationSubscriber();

$this->registerCommentController();
Expand All @@ -107,7 +106,7 @@ protected function registerNavigationFactory()
$this->app->singleton('navfactory', function ($app) {
$credentials = $app['credentials'];
$navigation = $app['navigation'];
$name = $app['config']['platform.name'];
$name = $app['config']['graham-campbell/core::platform.name'];
$property = $app['config']['cms.nav'];
$inverse = $app['config']['theme.inverse'];

Expand Down Expand Up @@ -207,21 +206,6 @@ protected function registerCommandSubscriber()
});
}

/**
* Register the core subscriber class.
*
* @return void
*/
protected function registerCoreSubscriber()
{
$this->app->singleton('GrahamCampbell\BootstrapCMS\Subscribers\CoreSubscriber', function ($app) {
$config = $app['config'];
$log = $app['log'];

return new Subscribers\CoreSubscriber($config, $log);
});
}

/**
* Register the navigation subscriber class.
*
Expand Down
21 changes: 0 additions & 21 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace GrahamCampbell\BootstrapCMS\Console;

use Exception;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
Expand All @@ -27,24 +26,4 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [];

/**
* Run the console application.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
*/
public function handle($input, $output = null)
{
try {
return parent::handle($input, $output);
} catch (Exception $e) {
$this->reportException($e);

$this->renderException($output, $e);

return 1;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* GNU Affero General Public License for more details.
*/

namespace GrahamCampbell\BootstrapCMS\Debug;
namespace GrahamCampbell\BootstrapCMS\Exceptions;

use Exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* GNU Affero General Public License for more details.
*/

namespace GrahamCampbell\BootstrapCMS\Debug;
namespace GrahamCampbell\BootstrapCMS\Exceptions;

use Exception;
use Whoops\Handler\PrettyPageHandler as Handler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* GNU Affero General Public License for more details.
*/

namespace GrahamCampbell\BootstrapCMS\Debug;
namespace GrahamCampbell\BootstrapCMS\Exceptions;

use Exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* GNU Affero General Public License for more details.
*/

namespace GrahamCampbell\BootstrapCMS\Debug;
namespace GrahamCampbell\BootstrapCMS\Exceptions;

use Exception;
use Illuminate\Contracts\Config\Repository as Config;
Expand Down
2 changes: 1 addition & 1 deletion app/Debug/InfoTrait.php → app/Exceptions/InfoTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* GNU Affero General Public License for more details.
*/

namespace GrahamCampbell\BootstrapCMS\Debug;
namespace GrahamCampbell\BootstrapCMS\Exceptions;

/**
* This is the exception info trait.
Expand Down
19 changes: 4 additions & 15 deletions app/Debug/PlainDisplayer.php → app/Exceptions/PlainDisplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
* GNU Affero General Public License for more details.
*/

namespace GrahamCampbell\BootstrapCMS\Debug;
namespace GrahamCampbell\BootstrapCMS\Exceptions;

use Exception;
use Illuminate\Contracts\Config\Repository as Config;
use Illuminate\Contracts\View\Factory as View;

/**
Expand All @@ -31,13 +30,6 @@ class PlainDisplayer implements DisplayerInterface
{
use InfoTrait;

/**
* The config repository instance.
*
* @var \Illuminate\Contracts\Config\Repository
*/
protected $config;

/**
* The view factory instance.
*
Expand All @@ -48,14 +40,12 @@ class PlainDisplayer implements DisplayerInterface
/**
* Create a new instance.
*
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Illuminate\Contracts\View\Factory $view
* @param \Illuminate\Contracts\View\Factory $view
*
* @return string
*/
public function __construct(Config $config, View $view)
public function __construct(View $view)
{
$this->config = $config;
$this->view = $view;
}

Expand All @@ -69,9 +59,8 @@ public function __construct(Config $config, View $view)
*/
public function display(Exception $exception, $code)
{
$view = $this->config->get('views.error', 'error');
$info = $this->info($code, $exception->getMessage());

return $this->view->make($view, $info)->render();
return $this->view->make('error', $info)->render();
}
}
19 changes: 1 addition & 18 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,11 @@ class Kernel extends HttpKernel
* @var array
*/
protected $middleware = [
// 'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
// 'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken',
];

/**
* Handle an incoming HTTP request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function handle($request)
{
try {
return parent::handle($request);
} catch (Exception $e) {
$this->reportException($e);

return $this->renderException($request, $e);
}
}
}
6 changes: 3 additions & 3 deletions app/Seeds/page-home.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="hidden-xs">
<div class="jumbotron">
<div class="hidden-sm">
<h1><?php echo Config::get("platform.name"); ?></h1>
<h1><?php echo Config::get("graham-campbell/core::platform.name"); ?></h1>
</div>
<div class="visible-sm">
<h1><?php echo Config::get("platform.name"); ?></h1>
<h1><?php echo Config::get("graham-campbell/core::platform.name"); ?></h1>
</div>
<p class="lead">Powered by Laravel 5 with Bootstrap CMS and Sentry</p>
<?php if (Config::get('graham-campbell/credentials::regallowed')) { ?>
Expand All @@ -17,7 +17,7 @@

<div class="visible-xs">
<div class="jumbotron">
<h1><?php echo Config::get("platform.name"); ?></h1>
<h1><?php echo Config::get("graham-campbell/core::platform.name"); ?></h1>
<p class="lead">Powered by Laravel 5 with Bootstrap CMS</p>
<?php if (Config::get('graham-campbell/credentials::regallowed')) { ?>
<a class="btn btn-lg btn-success" href="<?php echo URL::route("account.register"); ?>">Sign Up Today</a>
Expand Down
Loading

0 comments on commit 75ad28e

Please sign in to comment.