Re: Path of the class file of an object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings, "Ali Çevik".
In reply to Your message dated Saturday, September 6, 2008, 23:08:45,

> I need a procedure or an implementation that gives path of the class file of
> an object which I pass as a parameter.

> Example;

> Assume I have a class file located at C:\htdocs\Foo.class.php

> In code after I include Foo.class.php;

> <?php
> $foo = new Foo();
> Echo some_procedure($foo);
?>>

> I'm looking an implementation for that "some_procedure", which would make
> this program to print C:\htdocs\Foo.class.php .
> I have been googling around and also checked php.net but I wasn't able to
> find anything about this subject.

> It would be really helpful if someone knows that kind of procedure or at
> least has an implementation of it.

> Thanks in advance,

Include a method in your class, which would simply "return __FILE__;".
If all what you need is to print path to file containing class, if you
accessing your object as string, you could utilize magic of __toString().


-- 
Sincerely Yours, ANR Daemon <anrdaemon@xxxxxxxxxxx>


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux