Re: [PHP] How to find where class is used?

2012-01-06 Thread Dotan Cohen
On Fri, Jan 6, 2012 at 15:05, richard gray  wrote:
> Can you not put a debug_print_backtrace() in the class constructor?
>

Thanks, that might have worked.

In the end, I found it by grepping for VisitorMessaging instead of
vB_ProfileBlock_VisitorMessaging. It turns out that there is an array
of the vB_ProfileBlock_* classes and they are called by
vB_ProfileBlock_$className. I personally consider that terrible coding
practice, but then again if vBulletin were well-coded then I would
probably be made redundant so I cannot complain!

Thanks for the help and for the ideas!

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to find where class is used?

2012-01-06 Thread Nilesh Govindarajan
On Fri, Jan 6, 2012 at 6:35 PM, richard gray  wrote:
> On 06/01/2012 12:11, Dotan Cohen wrote:
>>
>> In a large application that I am tasked with maintaining (vBulletin)
>> there is a particular class that is used:
>> vB_ProfileBlock_VisitorMessaging. I know the file that it is defined
>> in, but I cannot find the file that actually creates a
>> vB_ProfileBlock_VisitorMessaging object. I tried the brute-force grep
>> approach, but the only place where I see the class mentioned is in the
>> class declaration itself:
>> [dev@localhost forum]$ grep -ir "vB_ProfileBlock_VisitorMessaging" *
>> includes/class_profileblock.php:class vB_ProfileBlock_VisitorMessaging
>> extends vB_ProfileBlock
>>
>> I know that this class is used as there is a page that is obviously
>> using it. I have tried playing be-the-PHP-parser with that file, but
>> it goes on to include() about a dozen other files, each of which
>> include() another dozen files! This server does not and cannot have a
>> debugger. What else can I do to find where this class object is
>> created?
>>
>> Thanks.
>
> Can you not put a debug_print_backtrace() in the class constructor?
>
>
>

That should do the job IMO.
Btw, ignore my earlier reply. I thought the task was to find where the
class was defined.

-- 
Nilesh Govindarajan
http://nileshgr.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to find where class is used?

2012-01-06 Thread richard gray

On 06/01/2012 12:11, Dotan Cohen wrote:

In a large application that I am tasked with maintaining (vBulletin)
there is a particular class that is used:
vB_ProfileBlock_VisitorMessaging. I know the file that it is defined
in, but I cannot find the file that actually creates a
vB_ProfileBlock_VisitorMessaging object. I tried the brute-force grep
approach, but the only place where I see the class mentioned is in the
class declaration itself:
[dev@localhost forum]$ grep -ir "vB_ProfileBlock_VisitorMessaging" *
includes/class_profileblock.php:class vB_ProfileBlock_VisitorMessaging
extends vB_ProfileBlock

I know that this class is used as there is a page that is obviously
using it. I have tried playing be-the-PHP-parser with that file, but
it goes on to include() about a dozen other files, each of which
include() another dozen files! This server does not and cannot have a
debugger. What else can I do to find where this class object is
created?

Thanks.

Can you not put a debug_print_backtrace() in the class constructor?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to find where class is used?

2012-01-06 Thread Nilesh Govindarajan
On Fri, Jan 6, 2012 at 5:08 PM, Curtis Maurand  wrote:
>
> it will be somewhere in php's search path.  you'd be better off trying
> search for a file of the same name.
>
> cd /usr/lib/php5
> find . -iname "vB_ProfileBlock*"
>
> if you have locate installed, try: "locate vB_ProfileBlock"
>

This works if vBulletin was installed as a system package. No other
package directly installs in php include paths.

OP should try this: grep -ir 'class vb_profileblock' 

-- 
Nilesh Govindarajan
http://nileshgr.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to find where class is used?

2012-01-06 Thread Curtis Maurand


it will be somewhere in php's search path.  you'd be better off trying 
search for a file of the same name.


cd /usr/lib/php5
find . -iname "vB_ProfileBlock*"

if you have locate installed, try: "locate vB_ProfileBlock"

Cheers,
Curtis

On 1/6/2012 6:11 AM, Dotan Cohen wrote:

In a large application that I am tasked with maintaining (vBulletin)
there is a particular class that is used:
vB_ProfileBlock_VisitorMessaging. I know the file that it is defined
in, but I cannot find the file that actually creates a
vB_ProfileBlock_VisitorMessaging object. I tried the brute-force grep
approach, but the only place where I see the class mentioned is in the
class declaration itself:
[dev@localhost forum]$ grep -ir "vB_ProfileBlock_VisitorMessaging" *
includes/class_profileblock.php:class vB_ProfileBlock_VisitorMessaging
extends vB_ProfileBlock

I know that this class is used as there is a page that is obviously
using it. I have tried playing be-the-PHP-parser with that file, but
it goes on to include() about a dozen other files, each of which
include() another dozen files! This server does not and cannot have a
debugger. What else can I do to find where this class object is
created?

Thanks.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to find where class is used?

2012-01-06 Thread Dotan Cohen
In a large application that I am tasked with maintaining (vBulletin)
there is a particular class that is used:
vB_ProfileBlock_VisitorMessaging. I know the file that it is defined
in, but I cannot find the file that actually creates a
vB_ProfileBlock_VisitorMessaging object. I tried the brute-force grep
approach, but the only place where I see the class mentioned is in the
class declaration itself:
[dev@localhost forum]$ grep -ir "vB_ProfileBlock_VisitorMessaging" *
includes/class_profileblock.php:class vB_ProfileBlock_VisitorMessaging
extends vB_ProfileBlock

I know that this class is used as there is a page that is obviously
using it. I have tried playing be-the-PHP-parser with that file, but
it goes on to include() about a dozen other files, each of which
include() another dozen files! This server does not and cannot have a
debugger. What else can I do to find where this class object is
created?

Thanks.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php