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
8ca1ee04
Commit
8ca1ee04
authored
Jun 16, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated vendors
parent
81afa6bd
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
32 additions
and
38 deletions
+32
-38
src/Silex/Application.php
src/Silex/Application.php
+13
-13
src/Silex/Extension/FormExtension.php
src/Silex/Extension/FormExtension.php
+1
-7
src/Silex/Extension/SessionExtension.php
src/Silex/Extension/SessionExtension.php
+2
-2
src/Silex/SilexEvents.php
src/Silex/SilexEvents.php
+4
-4
tests/Silex/Tests/RouterTest.php
tests/Silex/Tests/RouterTest.php
+2
-2
vendor/Symfony/Component/BrowserKit
vendor/Symfony/Component/BrowserKit
+1
-1
vendor/Symfony/Component/ClassLoader
vendor/Symfony/Component/ClassLoader
+1
-1
vendor/Symfony/Component/CssSelector
vendor/Symfony/Component/CssSelector
+1
-1
vendor/Symfony/Component/DomCrawler
vendor/Symfony/Component/DomCrawler
+1
-1
vendor/Symfony/Component/EventDispatcher
vendor/Symfony/Component/EventDispatcher
+1
-1
vendor/Symfony/Component/Finder
vendor/Symfony/Component/Finder
+1
-1
vendor/Symfony/Component/HttpFoundation
vendor/Symfony/Component/HttpFoundation
+1
-1
vendor/Symfony/Component/HttpKernel
vendor/Symfony/Component/HttpKernel
+1
-1
vendor/Symfony/Component/Process
vendor/Symfony/Component/Process
+1
-1
vendor/Symfony/Component/Routing
vendor/Symfony/Component/Routing
+1
-1
No files found.
src/Silex/Application.php
View file @
8ca1ee04
...
...
@@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use
Symfony\Component\HttpKernel\Event\FilterControllerEvent
;
use
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
;
use
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
;
use
Symfony\Component\HttpKernel\
Events
as
HttpKernel
Events
;
use
Symfony\Component\HttpKernel\
Core
Events
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\EventDispatcher\Event
;
...
...
@@ -69,7 +69,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$this
[
'dispatcher'
]
=
$this
->
share
(
function
()
use
(
$app
)
{
$dispatcher
=
new
EventDispatcher
();
$dispatcher
->
addSubscriber
(
$app
);
$dispatcher
->
addListener
(
HttpKernelEvents
::
onCoreView
,
$app
,
-
10
);
return
$dispatcher
;
});
...
...
@@ -189,7 +188,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
*/
public
function
before
(
$callback
)
{
$this
[
'dispatcher'
]
->
addListener
(
Events
::
onSilexBefore
,
$callback
);
$this
[
'dispatcher'
]
->
addListener
(
SilexEvents
::
BEFORE
,
$callback
);
}
/**
...
...
@@ -201,7 +200,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
*/
public
function
after
(
$callback
)
{
$this
[
'dispatcher'
]
->
addListener
(
Events
::
onSilexAfter
,
$callback
);
$this
[
'dispatcher'
]
->
addListener
(
SilexEvents
::
AFTER
,
$callback
);
}
/**
...
...
@@ -221,7 +220,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
*/
public
function
error
(
$callback
)
{
$this
[
'dispatcher'
]
->
addListener
(
Events
::
onSilexError
,
function
(
GetResponseForErrorEvent
$event
)
use
(
$callback
)
{
$this
[
'dispatcher'
]
->
addListener
(
SilexEvents
::
ERROR
,
function
(
GetResponseForErrorEvent
$event
)
use
(
$callback
)
{
$exception
=
$event
->
getException
();
$result
=
$callback
(
$exception
);
...
...
@@ -337,7 +336,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
}
catch
(
RoutingException
$e
)
{
// make sure onSilexBefore event is dispatched
$this
[
'dispatcher'
]
->
dispatch
(
Events
::
onSilexBefore
);
$this
[
'dispatcher'
]
->
dispatch
(
SilexEvents
::
BEFORE
);
if
(
$e
instanceof
ResourceNotFoundException
)
{
$message
=
sprintf
(
'No route found for "%s %s"'
,
$this
[
'request'
]
->
getMethod
(),
$this
[
'request'
]
->
getPathInfo
());
...
...
@@ -350,7 +349,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
throw
$e
;
}
$this
[
'dispatcher'
]
->
dispatch
(
Events
::
onSilexBefore
);
$this
[
'dispatcher'
]
->
dispatch
(
SilexEvents
::
BEFORE
);
}
/**
...
...
@@ -388,7 +387,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
*/
public
function
onCoreResponse
(
Event
$event
)
{
$this
[
'dispatcher'
]
->
dispatch
(
Events
::
onSilexAfter
);
$this
[
'dispatcher'
]
->
dispatch
(
SilexEvents
::
AFTER
);
}
/**
...
...
@@ -402,7 +401,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
public
function
onCoreException
(
GetResponseForExceptionEvent
$event
)
{
$errorEvent
=
new
GetResponseForErrorEvent
(
$this
,
$event
->
getRequest
(),
$event
->
getRequestType
(),
$event
->
getException
());
$this
[
'dispatcher'
]
->
dispatch
(
Events
::
onSilexError
,
$errorEvent
);
$this
[
'dispatcher'
]
->
dispatch
(
SilexEvents
::
ERROR
,
$errorEvent
);
if
(
$errorEvent
->
hasResponse
())
{
$event
->
setResponse
(
$errorEvent
->
getResponse
());
...
...
@@ -417,10 +416,11 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
// onCoreView listener is added manually because it has lower priority
return
array
(
HttpKernelEvents
::
onCoreRequest
,
HttpKernelEvents
::
onCoreController
,
HttpKernelEvents
::
onCoreResponse
,
HttpKernelEvents
::
onCoreException
,
CoreEvents
::
REQUEST
=>
'onCoreRequest'
,
CoreEvents
::
CONTROLLER
=>
'onCoreController'
,
CoreEvents
::
RESPONSE
=>
'onCoreResponse'
,
CoreEvents
::
EXCEPTION
=>
'onCoreException'
,
CoreEvents
::
VIEW
=>
array
(
'onCoreView'
,
-
10
),
);
}
}
src/Silex/Extension/FormExtension.php
View file @
8ca1ee04
...
...
@@ -13,7 +13,6 @@ namespace Silex\Extension;
use
Silex\Application
;
use
Silex\ExtensionInterface
;
use
Symfony\Component\HttpFoundation\File\TemporaryStorage
;
use
Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider
;
use
Symfony\Component\Form\FormFactory
;
use
Symfony\Component\Form\Extension\Core\CoreExtension
;
...
...
@@ -25,11 +24,10 @@ class FormExtension implements ExtensionInterface
public
function
register
(
Application
$app
)
{
$app
[
'form.secret'
]
=
md5
(
__DIR__
);
$app
[
'form.tmp_dir'
]
=
sys_get_temp_dir
();
$app
[
'form.factory'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
$extensions
=
array
(
new
CoreExtension
(
$app
[
'form.storage'
]
),
new
CoreExtension
(),
new
CsrfExtension
(
$app
[
'form.csrf_provider'
]),
);
...
...
@@ -44,10 +42,6 @@ class FormExtension implements ExtensionInterface
return
new
DefaultCsrfProvider
(
$app
[
'form.secret'
]);
});
$app
[
'form.storage'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
return
new
TemporaryStorage
(
$app
[
'form.secret'
],
$app
[
'form.tmp_dir'
]);
});
if
(
isset
(
$app
[
'form.class_path'
]))
{
$app
[
'autoloader'
]
->
registerNamespace
(
'Symfony\\Component\\Form'
,
$app
[
'form.class_path'
]);
}
...
...
src/Silex/Extension/SessionExtension.php
View file @
8ca1ee04
...
...
@@ -16,7 +16,7 @@ use Silex\ExtensionInterface;
use
Symfony\Component\HttpFoundation\SessionStorage\NativeSessionStorage
;
use
Symfony\Component\HttpFoundation\Session
;
use
Symfony\Component\HttpKernel\
Events
as
HttpKernel
Events
;
use
Symfony\Component\HttpKernel\
Core
Events
;
class
SessionExtension
implements
ExtensionInterface
{
...
...
@@ -34,7 +34,7 @@ class SessionExtension implements ExtensionInterface
return
new
NativeSessionStorage
(
$app
[
'session.storage.options'
]);
});
$app
[
'dispatcher'
]
->
addListener
(
HttpKernelEvents
::
onCoreRequest
,
$this
,
-
255
);
$app
[
'dispatcher'
]
->
addListener
(
CoreEvents
::
REQUEST
,
array
(
$this
,
'onCoreRequest'
)
,
-
255
);
if
(
!
isset
(
$app
[
'session.storage.options'
]))
{
$app
[
'session.storage.options'
]
=
array
();
...
...
src/Silex/Events.php
→
src/Silex/
Silex
Events.php
View file @
8ca1ee04
...
...
@@ -14,9 +14,9 @@ namespace Silex;
/**
* @author Igor Wiedler <igor@wiedler.ch>
*/
final
class
Events
final
class
Silex
Events
{
const
onSilexBefore
=
'onSilexBefore'
;
const
onSilexAfter
=
'onSilexAfter'
;
const
onSilexError
=
'onSilexError'
;
const
BEFORE
=
'onSilexBefore'
;
const
AFTER
=
'onSilexAfter'
;
const
ERROR
=
'onSilexError'
;
}
tests/Silex/Tests/RouterTest.php
View file @
8ca1ee04
...
...
@@ -89,11 +89,11 @@ class RouterTest extends \PHPUnit_Framework_TestCase
$request
=
Request
::
create
(
'/redirect'
);
$response
=
$app
->
handle
(
$request
);
$this
->
assertTrue
(
$response
->
isRedirect
ed
(
'/target'
));
$this
->
assertTrue
(
$response
->
isRedirect
(
'/target'
));
$request
=
Request
::
create
(
'/redirect2'
);
$response
=
$app
->
handle
(
$request
);
$this
->
assertTrue
(
$response
->
isRedirect
ed
(
'/target2'
));
$this
->
assertTrue
(
$response
->
isRedirect
(
'/target2'
));
}
/**
...
...
BrowserKit
@
d5060935
Subproject commit
a6dc07c9deaf59453a0e938af12ade5e01ed081
f
Subproject commit
d5060935745cbe509c39f36a34965ff67511282
f
ClassLoader
@
f289917e
Subproject commit
86fed40f30a64d0726ed19060d4b872f2feaaf7d
Subproject commit
f289917e07a7bcecb4d27c782fb9b4380136baa9
CssSelector
@
4e6c37f4
Subproject commit 4
f94a314de30ebfb6d4ab7375230f51efd8547d
a
Subproject commit 4
e6c37f450ee2aa82295e90ae8d286c44b0d3d9
a
DomCrawler
@
8bd13e89
Subproject commit
2a0285242c9c53bdb0e0650d7578611e03a0ad34
Subproject commit
8bd13e894b42e2735384c99c3be962e8d2c3e5df
EventDispatcher
@
87fdf453
Subproject commit
35999b442a660774cc78df1034ae02dad8568206
Subproject commit
87fdf4537232724309306cb08edf19e69e78132f
Finder
@
83d148b1
Subproject commit
42709a7857fd46fd67fdb452302f1b0bdcd4eccb
Subproject commit
83d148b10f3acf2a1d1cc427386a1d3d1a125206
HttpFoundation
@
a20dc40f
Subproject commit
3fe5b472d0c9888347caa13ff706a6076672b8d9
Subproject commit
a20dc40fa90b47663017cf7f2f628ca90909985a
HttpKernel
@
7442467e
Subproject commit
ce4f2e6b3446ac4f9d3b65ddb2391acb033bd077
Subproject commit
7442467e4bbba0c7c26960f1dc8211cc11c5298f
Process
@
a6acc9ac
Subproject commit a
003d069fc7b15b58538638ec963881bd6910b33
Subproject commit a
6acc9ac44956f65806dccab6ca89ab1c2308e4f
Routing
@
66ab5135
Subproject commit
06a4275c5835aaa8be56bbd765a7c0d8cf6f1631
Subproject commit
66ab5135dafa42c1a41b3045a269834a243ef798
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