php-general Digest 7 Sep 2008 13:13:33 -0000 Issue 5668

Topics (messages 279605 through 279610):

Re: Path of the class file of an object
        279605 by: Stut
        279606 by: Ali Çevik
        279608 by: ANR Daemon

Re: Geometrical library
        279607 by: Manuel Lemos
        279609 by: Yannick Warnier

php image and javascript include
        279610 by: javasac

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On 6 Sep 2008, at 20:08, Ali Çevik wrote:
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.

The only way I know to do this would be to add a method to your class to give it to you.

class Foo
{
    public function getClassFilename()
    {
        return __FILE__;
    }
}

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
    Hmm, that should do the trick. Thanks a lot!
    But still, I wish there were a way of doing that, without altering the
class behaviour.


>
>
> Ali Cevik.
>
> On Sat, Sep 6, 2008 at 11:58 PM, Stut <[EMAIL PROTECTED]> wrote:
>
>> On 6 Sep 2008, at 20:08, Ali Çevik wrote:
>>
>>> 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.
>>>
>>
>> The only way I know to do this would be to add a method to your class to
>> give it to you.
>>
>> class Foo
>> {
>>    public function getClassFilename()
>>    {
>>        return __FILE__;
>>    }
>> }
>>
>> -Stut
>>
>> --
>> http://stut.net/
>
>
>

--- End Message ---
--- Begin Message ---
Greetings, "Ali Çevik".
In reply to Your message dated Sunday, September 7, 2008, 1:51:33,

>>>> 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.
>>>>
>>>
>>> The only way I know to do this would be to add a method to your class to
>>> give it to you.
>>>
>>> class Foo
>>> {
>>>    public function getClassFilename()
>>>    {
>>>        return __FILE__;
>>>    }
>>> }

>     Hmm, that should do the trick. Thanks a lot!
>     But still, I wish there were a way of doing that, without altering the
> class behaviour.

(top posting fixed)

Ok, if you prefer backward solution - hook your own error-handler and cause an
error in class, then you'll have path to it's file in backtrace.
I mean, knowing the filename of this or that function absolutely meaningless,
unless you're running into problem of some sort.


-- 
Sincerely Yours, ANR Daemon <[EMAIL PROTECTED]>


--- End Message ---
--- Begin Message ---
Hello,

on 09/03/2008 01:54 PM Yannick Warnier said the following:
Hi there,

I've been looking for a PHP library that would allow me to calculate
superpositions of geometrical surfaces defined by polygones (defined
themselves by points bound with lines) in 2D (surface of a polygone,
intersections between two vectors, surface of intersection - considering
the polygons could be complex and superpose themselves in more than one
point).

The closest to what I'm looking for, I guess, would be the PEAR
Math_Vector package, but it is mainly based on vectors as mathematical
arrays, whereas I would need calculations based on surfaces.

Does anyone know of something that could help me?

I think this PHP class does exactly what you need:

http://www.phpclasses.org/polygon

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Le samedi 06 septembre 2008 à 23:09 -0300, Manuel Lemos a écrit :
> Hello,
> 
> on 09/03/2008 01:54 PM Yannick Warnier said the following:
> > Hi there,
> > 
> > I've been looking for a PHP library that would allow me to calculate
> > superpositions of geometrical surfaces defined by polygones (defined
> > themselves by points bound with lines) in 2D (surface of a polygone,
> > intersections between two vectors, surface of intersection - considering
> > the polygons could be complex and superpose themselves in more than one
> > point).
> > 
> > The closest to what I'm looking for, I guess, would be the PEAR
> > Math_Vector package, but it is mainly based on vectors as mathematical
> > arrays, whereas I would need calculations based on surfaces.
> > 
> > Does anyone know of something that could help me?
> 
> I think this PHP class does exactly what you need:
> 
> http://www.phpclasses.org/polygon

Seems to be pretty much everything I needed, indeed. Pretty hard to find
through Google though. Thank you *very* much.

Yannick


--- End Message ---
--- Begin Message ---
Hi All,

Strange issue here. I m including images and javascript in my php file. None
of them show/work up.
If i change the .php file to .html, both thing start working. So no issues
with path and all.

Any idea?

Thanks,
Sachin
-- 
View this message in context: 
http://www.nabble.com/php-image-and-javascript-include-tp19357706p19357706.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---

Reply via email to