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
06cb63f5
Commit
06cb63f5
authored
Jul 07, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed route\loader and route\parser classes.
parent
ad824341
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
75 deletions
+0
-75
system/route/loader.php
+0
-41
system/route/parser.php
+0
-34
No files found.
system/route/loader.php
deleted
100644 → 0
View file @
ad824341
<?php
namespace
System\Route
;
class
Loader
{
/**
* Load the route file based on the first segment of the URI.
*
* @param string $uri
* @return void
*/
public
static
function
load
(
$uri
)
{
if
(
!
is_dir
(
APP_PATH
.
'routes'
))
{
return
require
APP_PATH
.
'routes'
.
EXT
;
}
if
(
!
file_exists
(
APP_PATH
.
'routes/home'
.
EXT
))
{
throw
new
\Exception
(
"A [home] route file is required when using a route directory."
);
}
if
(
$uri
==
'/'
)
{
return
require
APP_PATH
.
'routes/home'
.
EXT
;
}
else
{
$segments
=
explode
(
'/'
,
trim
(
$uri
,
'/'
));
if
(
!
file_exists
(
APP_PATH
.
'routes/'
.
$segments
[
0
]
.
EXT
))
{
return
require
APP_PATH
.
'routes/home'
.
EXT
;
}
return
array_merge
(
require
APP_PATH
.
'routes/'
.
$segments
[
0
]
.
EXT
,
require
APP_PATH
.
'routes/home'
.
EXT
);
}
}
}
\ No newline at end of file
system/route/parser.php
deleted
100644 → 0
View file @
ad824341
<?php
namespace
System\Route
;
class
Parser
{
/**
* Get the parameters that should be passed to the route callback.
*
* @param string $uri
* @param string $route
* @return array
*/
public
static
function
parameters
(
$uri
,
$route
)
{
$parameters
=
array
();
$uri_segments
=
explode
(
'/'
,
$uri
);
$route_segments
=
explode
(
'/'
,
$route
);
// --------------------------------------------------------------
// Any route segment wrapped in parentheses is a parameter.
// --------------------------------------------------------------
for
(
$i
=
0
;
$i
<
count
(
$route_segments
);
$i
++
)
{
if
(
strpos
(
$route_segments
[
$i
],
'('
)
===
0
)
{
$parameters
[]
=
$uri_segments
[
$i
];
}
}
return
$parameters
;
}
}
\ No newline at end of file
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