Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
ec615cfa
Commit
ec615cfa
authored
Aug 23, 2013
by
Tobias Schultze
Committed by
Fabien Potencier
Aug 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove deprecated calls in Route
parent
1f1fc4e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
src/Silex/Route.php
src/Silex/Route.php
+21
-5
No files found.
src/Silex/Route.php
View file @
ec615cfa
...
...
@@ -20,9 +20,25 @@ use Symfony\Component\Routing\Route as BaseRoute;
*/
class
Route
extends
BaseRoute
{
public
function
__construct
(
$pattern
=
''
,
array
$defaults
=
array
(),
array
$requirements
=
array
(),
array
$options
=
array
())
/**
* Constructor.
*
* Available options:
*
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
*
* @param string $path The path pattern to match
* @param array $defaults An array of default parameter values
* @param array $requirements An array of requirements for parameters (regexes)
* @param array $options An array of options
* @param string $host The host pattern to match
* @param string|array $schemes A required URI scheme or an array of restricted schemes
* @param string|array $methods A required HTTP method or an array of restricted methods
*/
public
function
__construct
(
$path
=
'/'
,
array
$defaults
=
array
(),
array
$requirements
=
array
(),
array
$options
=
array
(),
$host
=
''
,
$schemes
=
array
(),
$methods
=
array
())
{
parent
::
__construct
(
$pattern
,
$defaults
,
$requirements
,
$options
);
// overridden constructor to make $path optional
parent
::
__construct
(
$path
,
$defaults
,
$requirements
,
$options
,
$host
,
$schemes
,
$methods
);
}
/**
...
...
@@ -81,7 +97,7 @@ class Route extends BaseRoute
*/
public
function
method
(
$method
)
{
$this
->
set
Requirement
(
'_method'
,
$method
);
$this
->
set
Methods
(
explode
(
'|'
,
$method
)
);
return
$this
;
}
...
...
@@ -107,7 +123,7 @@ class Route extends BaseRoute
*/
public
function
requireHttp
()
{
$this
->
set
Requirement
(
'_scheme'
,
'http'
);
$this
->
set
Schemes
(
'http'
);
return
$this
;
}
...
...
@@ -119,7 +135,7 @@ class Route extends BaseRoute
*/
public
function
requireHttps
()
{
$this
->
set
Requirement
(
'_scheme'
,
'https'
);
$this
->
set
Schemes
(
'https'
);
return
$this
;
}
...
...
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