This commit is contained in:
Graham Campbell
2015-01-01 17:47:37 +00:00
parent be078cc2e8
commit fcf68b3aea
3 changed files with 34 additions and 29 deletions

View File

@@ -71,7 +71,5 @@ App::down(function () {
*/
require app_path().'/filters.php';
require app_path().'/view-composers.php';
require app_path().'/helpers.php';

View File

@@ -6,6 +6,21 @@ use Illuminate\Support\ServiceProvider;
class RepositoryServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->bind(

View File

@@ -3,38 +3,30 @@
namespace CachetHQ\Cachet\Providers;
use Illuminate\Support\ServiceProvider;
use RecursiveDirectoryIterator;
class RoutingServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/
public function boot()
{
$files = glob(app_path('routes').'/*.php');
foreach ($files as $file) {
require $file;
}
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
public function boot()
{
$this->routesInDirectory();
}
/**
* Organise Routes.
*
* @param string $app
*/
private function routesInDirectory($app = '')
{
$routeDir = app_path('routes/'.$app.($app !== '' ? '/' : null));
$iterator = new RecursiveDirectoryIterator($routeDir);
$iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS);
foreach ($iterator as $route) {
$isDotFile = strpos($route->getFilename(), '.') === 0;
if (!$isDotFile && !$route->isDir()) {
require $routeDir.$route->getFilename();
}
}
}
}