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
34e3306e
Commit
34e3306e
authored
Feb 04, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to latest Symfony2, re-introduce getRequest()
parent
150e322e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
src/Silex/Framework.php
src/Silex/Framework.php
+16
-2
src/autoload.php
src/autoload.php
+2
-2
src/vendor/symfony
src/vendor/symfony
+1
-1
No files found.
src/Silex/Framework.php
View file @
34e3306e
...
@@ -30,6 +30,7 @@ class Framework extends HttpKernel
...
@@ -30,6 +30,7 @@ class Framework extends HttpKernel
{
{
protected
$routes
;
protected
$routes
;
protected
$handlers
=
array
(
'error'
=>
array
(),
'before'
=>
array
(),
'after'
=>
array
());
protected
$handlers
=
array
(
'error'
=>
array
(),
'before'
=>
array
(),
'after'
=>
array
());
protected
$request
;
/**
/**
* Constructor.
* Constructor.
...
@@ -59,6 +60,16 @@ class Framework extends HttpKernel
...
@@ -59,6 +60,16 @@ class Framework extends HttpKernel
parent
::
__construct
(
$dispatcher
,
$resolver
);
parent
::
__construct
(
$dispatcher
,
$resolver
);
}
}
/**
* Get the current request.
*
* @return Symfony\Component\HttpFoundation\Request
*/
public
function
getRequest
()
{
return
$this
->
request
;
}
/**
/**
* Map a pattern to a callable.
* Map a pattern to a callable.
*
*
...
@@ -272,6 +283,8 @@ class Framework extends HttpKernel
...
@@ -272,6 +283,8 @@ class Framework extends HttpKernel
}
}
$request
->
attributes
->
add
(
$attributes
);
$request
->
attributes
->
add
(
$attributes
);
$this
->
request
=
$request
;
}
}
/**
/**
...
@@ -332,15 +345,16 @@ class Framework extends HttpKernel
...
@@ -332,15 +345,16 @@ class Framework extends HttpKernel
public
function
handleException
(
Event
$event
)
public
function
handleException
(
Event
$event
)
{
{
$exception
=
$event
->
get
(
'exception'
);
$exception
=
$event
->
get
(
'exception'
);
$prevResult
=
null
;
$
response
=
$
prevResult
=
null
;
foreach
(
$this
->
handlers
[
'error'
]
as
$callback
)
{
foreach
(
$this
->
handlers
[
'error'
]
as
$callback
)
{
$result
=
$callback
(
$exception
);
$result
=
$callback
(
$exception
);
if
(
null
!==
$result
&&
!
$prevResult
)
{
if
(
null
!==
$result
&&
!
$prevResult
)
{
$response
=
$this
->
parseResponse
(
$event
,
$result
);
$response
=
$this
->
parseResponse
(
$event
,
$result
);
$event
->
setReturnValue
(
$response
);
$event
->
setProcessed
(
true
);
$event
->
setProcessed
(
true
);
$prevResult
=
$result
;
$prevResult
=
$result
;
}
}
}
}
return
$response
;
}
}
}
}
src/autoload.php
View file @
34e3306e
<?php
<?php
require_once
__DIR__
.
'/vendor/symfony/src/Symfony/Component/
HttpFoundation
/UniversalClassLoader.php'
;
require_once
__DIR__
.
'/vendor/symfony/src/Symfony/Component/
ClassLoader
/UniversalClassLoader.php'
;
use
Symfony\Component\
HttpFoundation
\UniversalClassLoader
;
use
Symfony\Component\
ClassLoader
\UniversalClassLoader
;
$loader
=
new
UniversalClassLoader
();
$loader
=
new
UniversalClassLoader
();
$loader
->
registerNamespaces
(
array
(
$loader
->
registerNamespaces
(
array
(
...
...
symfony
@
c05fb03c
Subproject commit
36d87d94648e11b52ad55f82ec781aa01bd16ca9
Subproject commit
c05fb03c7db973df27111434fa9643d0e130ddcc
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