Permalink
Browse files

Remove the debug option.

If want to hide runtime error, should update bootstrap.php.cache's error reporting setting instead. In Kernel->init() , change `error_reporting(-1)` to `error_reporting(E_ALL ^ E_NOTICE)`.
  • Loading branch information...
kayue committed Jan 21, 2012
1 parent c39f957 commit ff6a72982960c030b8be01a7ebadab626217f7a5
Showing with 3 additions and 16 deletions.
  1. +0 −1 DependencyInjection/Configuration.php
  2. +3 −14 Extensions/WordpressTwigExtension.php
  3. +0 −1 Resources/config/services.xml
@@ -20,7 +20,6 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('wordpress_path')->isRequired()->cannotBeEmpty()->end()
->booleanNode('short_init')->defaultValue(false)->end()
- ->booleanNode('debug')->defaultValue(false)->end()
->end()
;
@@ -10,13 +10,6 @@
*/
class WordpressTwigExtension extends \Twig_Extension
{
- protected $debug = false;
-
- public function __construct($debug)
- {
- $this->debug = $debug;
- }
-
public function getName()
{
return 'wordpress';
@@ -32,13 +25,9 @@ public function getGlobals()
public function __call($function, $arguments) {
$function = $this->camelcaseToUnderscore($function);
- // Since a lot of Wordpress plugins are poorly written, the WordpressBundle
- // will try to not display any error message.
- if($this->debug) {
- return call_user_func_array($function, $arguments);
- }
-
- return @call_user_func_array($function, $arguments);
+ // Since a lot of Wordpress plugins are poorly written, we recommend you
+ // turn of PHP's runtime notice when debugging.
+ return call_user_func_array($function, $arguments);
}
/**
@@ -59,7 +59,6 @@
<service id="wordpress.twig.extension"
class="Hypebeast\WordpressBundle\Extensions\WordpressTwigExtension"
public="true">
- <argument>%hypebeast_wordpress.debug%</argument>
<tag name="twig.extension" />
</service>

0 comments on commit ff6a729

Please sign in to comment.