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
426cde53
Commit
426cde53
authored
Apr 11, 2015
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed compatibility with 2.7
parent
5f661aa1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
10 deletions
+16
-10
doc/changelog.rst
doc/changelog.rst
+1
-0
doc/services.rst
doc/services.rst
+3
-3
doc/testing.rst
doc/testing.rst
+1
-1
src/Silex/ExceptionHandler.php
src/Silex/ExceptionHandler.php
+3
-0
tests/Silex/Tests/ApplicationTest.php
tests/Silex/Tests/ApplicationTest.php
+1
-1
tests/Silex/Tests/ExceptionHandlerTest.php
tests/Silex/Tests/ExceptionHandlerTest.php
+4
-2
tests/Silex/Tests/Provider/RememberMeServiceProviderTest.php
tests/Silex/Tests/Provider/RememberMeServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
+1
-1
tests/Silex/Tests/RouterTest.php
tests/Silex/Tests/RouterTest.php
+1
-1
No files found.
doc/changelog.rst
View file @
426cde53
...
@@ -4,6 +4,7 @@ Changelog
...
@@ -4,6 +4,7 @@ Changelog
1.3.0 (2015-XX-XX)
1.3.0 (2015-XX-XX)
------------------
------------------
* deprecated `$app['exception_handler']->disable()` in favor of `unset($app['exception_handler'])`
* made Silex compatible with Symfony 2.7 (and keep compatibility with Symfony 2.3, 2.5, and 2.6)
* made Silex compatible with Symfony 2.7 (and keep compatibility with Symfony 2.3, 2.5, and 2.6)
* removed deprecated TwigCoreExtension class (register the new HttpFragmentServiceProvider instead)
* removed deprecated TwigCoreExtension class (register the new HttpFragmentServiceProvider instead)
* bumped minimum version of PHP to 5.3.9
* bumped minimum version of PHP to 5.3.9
...
...
doc/services.rst
View file @
426cde53
...
@@ -221,9 +221,9 @@ don't want to mess with most of them.
...
@@ -221,9 +221,9 @@ don't want to mess with most of them.
the request that is used by the Router and the UrlGenerator.
the request that is used by the Router and the UrlGenerator.
* **exception_handler**: The Exception handler is the default handler that is
* **exception_handler**: The Exception handler is the default handler that is
used when you don't register one via the ``error()`` method or if your
handler
used when you don't register one via the ``error()`` method or if your
does not return a Response. Disable it with
handler
does not return a Response. Disable it with
``
$app['exception_handler']->disable(
)``.
``
unset($app['exception_handler']
)``.
* **logger**: A ``Psr\Log\LoggerInterface`` instance. By default, logging is
* **logger**: A ``Psr\Log\LoggerInterface`` instance. By default, logging is
disabled as the value is set to ``null``. To enable logging you can either use
disabled as the value is set to ``null``. To enable logging you can either use
...
...
doc/testing.rst
View file @
426cde53
...
@@ -108,7 +108,7 @@ executed before every test.
...
@@ -108,7 +108,7 @@ executed before every test.
{
{
$app = require __DIR__.'/path/to/app.php';
$app = require __DIR__.'/path/to/app.php';
$app['debug'] = true;
$app['debug'] = true;
$app['exception_handler']->disable(
);
unset($app['exception_handler']
);
return $app;
return $app;
}
}
...
...
src/Silex/ExceptionHandler.php
View file @
426cde53
...
@@ -32,6 +32,9 @@ class ExceptionHandler implements EventSubscriberInterface
...
@@ -32,6 +32,9 @@ class ExceptionHandler implements EventSubscriberInterface
$this
->
enabled
=
true
;
$this
->
enabled
=
true
;
}
}
/**
* @deprecated since 1.3, to be removed in 2.0
*/
public
function
disable
()
public
function
disable
()
{
{
$this
->
enabled
=
false
;
$this
->
enabled
=
false
;
...
...
tests/Silex/Tests/ApplicationTest.php
View file @
426cde53
...
@@ -525,7 +525,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
...
@@ -525,7 +525,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public
function
testGetRouteCollectionWithRouteWithoutController
()
public
function
testGetRouteCollectionWithRouteWithoutController
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'exception_handler'
]
->
disable
(
);
unset
(
$app
[
'exception_handler'
]
);
$app
->
match
(
'/'
)
->
bind
(
'homepage'
);
$app
->
match
(
'/'
)
->
bind
(
'homepage'
);
$app
->
handle
(
Request
::
create
(
'/'
));
$app
->
handle
(
Request
::
create
(
'/'
));
}
}
...
...
tests/Silex/Tests/ExceptionHandlerTest.php
View file @
426cde53
...
@@ -107,7 +107,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -107,7 +107,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
public
function
testNoExceptionHandler
()
public
function
testNoExceptionHandler
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'exception_handler'
]
->
disable
(
);
unset
(
$app
[
'exception_handler'
]
);
$app
->
match
(
'/foo'
,
function
()
{
$app
->
match
(
'/foo'
,
function
()
{
throw
new
\RuntimeException
(
'foo exception'
);
throw
new
\RuntimeException
(
'foo exception'
);
...
@@ -207,6 +207,8 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -207,6 +207,8 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
fail
(
'->handle() should not catch exceptions where an empty error handler was supplied'
);
$this
->
fail
(
'->handle() should not catch exceptions where an empty error handler was supplied'
);
}
catch
(
\RuntimeException
$e
)
{
}
catch
(
\RuntimeException
$e
)
{
$this
->
assertEquals
(
'foo exception'
,
$e
->
getMessage
());
$this
->
assertEquals
(
'foo exception'
,
$e
->
getMessage
());
}
catch
(
\LogicException
$e
)
{
$this
->
assertEquals
(
'foo exception'
,
$e
->
getPrevious
()
->
getMessage
());
}
}
$this
->
assertEquals
(
1
,
$errors
,
'should execute the error handler'
);
$this
->
assertEquals
(
1
,
$errors
,
'should execute the error handler'
);
...
@@ -261,7 +263,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -261,7 +263,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// just making sure the dispatcher gets created
// just making sure the dispatcher gets created
});
});
$app
[
'exception_handler'
]
->
disable
(
);
unset
(
$app
[
'exception_handler'
]
);
try
{
try
{
$request
=
Request
::
create
(
'/foo'
);
$request
=
Request
::
create
(
'/foo'
);
...
...
tests/Silex/Tests/Provider/RememberMeServiceProviderTest.php
View file @
426cde53
...
@@ -63,7 +63,7 @@ class RememberMeServiceProviderTest extends WebTestCase
...
@@ -63,7 +63,7 @@ class RememberMeServiceProviderTest extends WebTestCase
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
true
;
$app
[
'debug'
]
=
true
;
$app
[
'exception_handler'
]
->
disable
(
);
unset
(
$app
[
'exception_handler'
]
);
$app
->
register
(
new
SessionServiceProvider
(),
array
(
$app
->
register
(
new
SessionServiceProvider
(),
array
(
'session.test'
=>
true
,
'session.test'
=>
true
,
...
...
tests/Silex/Tests/Provider/SessionServiceProviderTest.php
View file @
426cde53
...
@@ -94,7 +94,7 @@ class SessionServiceProviderTest extends WebTestCase
...
@@ -94,7 +94,7 @@ class SessionServiceProviderTest extends WebTestCase
});
});
$app
[
'debug'
]
=
true
;
$app
[
'debug'
]
=
true
;
$app
[
'exception_handler'
]
->
disable
(
);
unset
(
$app
[
'exception_handler'
]
);
$client
=
new
Client
(
$app
);
$client
=
new
Client
(
$app
);
...
...
tests/Silex/Tests/RouterTest.php
View file @
426cde53
...
@@ -100,7 +100,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase
...
@@ -100,7 +100,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase
public
function
testMissingRoute
()
public
function
testMissingRoute
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'exception_handler'
]
->
disable
(
);
unset
(
$app
[
'exception_handler'
]
);
$request
=
Request
::
create
(
'/baz'
);
$request
=
Request
::
create
(
'/baz'
);
$app
->
handle
(
$request
);
$app
->
handle
(
$request
);
...
...
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