Skip to content

Commit

Permalink
Fixed namespace issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Jun 20, 2015
1 parent 10c669b commit de4ede3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
29 changes: 16 additions & 13 deletions src/Installer/Index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
* Load the Composer Autoloader
*/

include 'vendor/autoload.php';
require realpath('vendor') . '/autoload.php';

/**
* Import the Slytherin namespace
*/

use Pux\Mux;
use Rougin\Slytherin\Application;
use Rougin\Slytherin\View;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;

/**
* This is where you can change the environment
Expand Down Expand Up @@ -32,33 +42,26 @@ $environment = 'development';
* Register the error handler
*/

$whoops = new \Whoops\Run;
$whoops = new Run;

if ($environment !== 'production') {
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->pushHandler(new PrettyPageHandler);
} else {
$whoops->pushHandler(function ($error) {
echo \Slytherin\View::render('404');
echo View::render('404');
});
}

$whoops->register();

/**
* Import the Slytherin namespace
*/

use Slytherin\Application;
use Slytherin\Config;

/**
* Load Pux's Mux (https://github.com/c9s/Pux)
*/

$route = new \Pux\Mux();
$route = new Mux();

/**
* Initialize and Run Slytherin
* Initialize and run Slytherin
*/

$app = new Application($route);
Expand Down
4 changes: 2 additions & 2 deletions src/Installer/Welcome.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace Controllers;

use Slytherin\Controller;
use Slytherin\View;
use Rougin\Slytherin\Controller;
use Rougin\Slytherin\View;

/**
* Welcome Controller Class
Expand Down

0 comments on commit de4ede3

Please sign in to comment.