Commit 78dc4529 by Taylor Otwell

added routed array.

parent a4acb1c0
...@@ -24,6 +24,13 @@ class Bundle { ...@@ -24,6 +24,13 @@ class Bundle {
public static $started = array(); public static $started = array();
/** /**
* All of the bundles that have their routes files loaded.
*
* @var array
*/
public static $routed = array();
/**
* Register a bundle for the application. * Register a bundle for the application.
* *
* @param string $bundle * @param string $bundle
...@@ -107,10 +114,14 @@ class Bundle { ...@@ -107,10 +114,14 @@ class Bundle {
*/ */
public static function routes($bundle) public static function routes($bundle)
{ {
if (file_exists($path = static::path($bundle).'routes'.EXT)) $path = static::path($bundle).'routes'.EXT;
if ( ! static::routed($bundle) and file_exists($path))
{ {
require $path; require $path;
} }
static::$routed[] = $bundle;
} }
/** /**
...@@ -156,6 +167,17 @@ class Bundle { ...@@ -156,6 +167,17 @@ class Bundle {
} }
/** /**
* Determine if a given bundle has its routes file loaded.
*
* @param string $bundle
* @return void
*/
public static function routed($bundle)
{
return in_array(strtolower($bundle), static::$routed);
}
/**
* Get the identifier prefix for the bundle. * Get the identifier prefix for the bundle.
* *
* @param string $bundle * @param string $bundle
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment