Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
57e65327
Commit
57e65327
authored
Aug 03, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrating back to old routing system.
parent
63694de7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
system/routing/loader.php
+5
-5
No files found.
system/routing/loader.php
View file @
57e65327
...
...
@@ -52,9 +52,9 @@ class Loader {
// matching route directory. Once we find it, we will return those routes.
foreach
(
array_reverse
(
$segments
,
true
)
as
$key
=>
$value
)
{
if
(
is_dir
(
$path
=
$this
->
path
.
implode
(
'/'
,
array_slice
(
$segments
,
0
,
$key
+
1
))
))
if
(
file_exists
(
$path
=
$this
->
path
.
'routes/'
.
implode
(
'/'
,
array_slice
(
$segments
,
0
,
$key
+
1
))
.
EXT
))
{
return
(
file_exists
(
$path
=
$path
.
'/routes'
.
EXT
))
?
require
$path
:
array
()
;
return
require
$path
;
}
}
...
...
@@ -71,7 +71,7 @@ class Loader {
* @param string $path
* @return array
*/
public
static
function
all
(
$reload
=
false
,
$path
=
ROUTE
_PATH
)
public
static
function
all
(
$reload
=
false
,
$path
=
APP
_PATH
)
{
if
(
!
is_null
(
static
::
$routes
)
and
!
$reload
)
return
static
::
$routes
;
...
...
@@ -79,13 +79,13 @@ class Loader {
// Since route files can be nested deep within the route directory, we need to
// recursively spin through the directory to find every file.
$directoryIterator
=
new
\RecursiveDirectoryIterator
(
$path
);
$directoryIterator
=
new
\RecursiveDirectoryIterator
(
$path
.
'routes'
);
$recursiveIterator
=
new
\RecursiveIteratorIterator
(
$directoryIterator
,
\RecursiveIteratorIterator
::
SELF_FIRST
);
foreach
(
$recursiveIterator
as
$file
)
{
if
(
filetype
(
$file
)
===
'file'
and
strpos
(
$file
,
EXT
)
!==
false
and
strpos
(
$file
,
'filters'
.
EXT
)
===
false
)
if
(
filetype
(
$file
)
===
'file'
and
strpos
(
$file
,
EXT
)
!==
false
)
{
$routes
=
array_merge
(
require
$file
,
$routes
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment