-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getVariableName() won't work correct #12
Comments
Thank you. I have fixed this a bit better than you have suggested (allowed to work with inherited classes, have to use reflection for this). I haven't implemented the new regex because haven't analysed it yet. This maybe will be an another commit when I have time for it. Feel fre to make PRs |
Hi, Regards |
Hi KOLANICH, I extend my extented constructor with a new parameter. Then I extend my own getVariableName() function with a check that looks for the headline and the fallback ist the original name search. Here is my code: use dBug\dBug;
class myOwn_dBug extends dBug
{
/**
* Headline
*
* @var string
*/
public $error_headline = '';
/**
* Construktor
*
* @param array $a_var Variable to dump
* @param string $a_forceType type to marshall $var to show
* @param boolean $a_bCollapsed should output be collapsed
* @param string $a_headline text for the error block header
*/
public function __construct( $a_var, $a_forceType = "", $a_bCollapsed = false, $a_headline = '' )
{
# Headline if available
if ( !empty( $a_headline ) )
{
$this->error_headline = $a_headline;
}
parent::__construct( $a_var, $a_forceType, $a_bCollapsed );
} # function __construct(...)
/**
* Headline
*
* @var string
*/
public $error_headline = '';
/**
* set the headline for the error block
*/
public function getVariableName()
{
# if headline is set use it
if ( !empty( $this->error_headline ) )
{
return $this->error_headline;
}
#... original code is here...
} # function getVariableName()
#... my other code is here
} # class new myOwn_dBug( $post_data, '', false, 'POST data' ); Regards |
Thank you, in fact the tools like this were never meant to be used in production, because they disclose too much information to a potential attacker. About Zend Guard... you should have no sense using it because there are lots of decompilers. Most of widespread bytecode-compiled binaries can be easily decompiled. |
Thanks for the tip. We will discuss it. |
There are 2 problems in it.
The constructor was switched to the php 5+ call
__construct
. So__construct
is in the Array and the clause fails because you are looking for the old constructordBug
.OLD:
NEW:
When this part is corrected the function fails because the RegEx-pattern does not work. You added namespaces. So I have to this for example:
OLD:
NEW:
The pattern
'/\bnew dBug\s*\(\s*(.+)\s*\);/i'
looks for the old string. When I change the preg_match-function fromOLD:
to
NEW:
and changes the return clause to
only the name of the variable returned.
We are using dBug in our project and debugging a lot of variables. We are having a error page where we see all of them. So we are really need the variable names.
The text was updated successfully, but these errors were encountered: