php-general Digest 6 Sep 2008 08:34:29 -0000 Issue 5666
php-general Digest 6 Sep 2008 08:34:29 - Issue 5666 Topics (messages 279566 through 279589): Re: Sending POST variables without html code 279566 by: Robert Cummings Re: Google Chrome 279567 by: TG 279589 by: Richard Heyes Sending username/password 279568 by: Jay Moore 279569 by: Robert Cummings 279570 by: Wolf 279571 by: Stut 279572 by: Jay Moore 279573 by: Robert Cummings 279574 by: Jay Moore 279575 by: Stut 279576 by: Jay Moore 279577 by: Robert Cummings 279578 by: Robert Cummings 279579 by: Micah Gersten 279580 by: Jochem Maas 279581 by: Jay Moore 279582 by: Jay Moore 279583 by: Stut 279585 by: Robert Cummings 279586 by: Robert Cummings 279587 by: Robert Cummings Re: Using DOM textContent Property 279584 by: Tim Gustafson 279588 by: Nathan Nobbe 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] -- ---BeginMessage--- On Fri, 2008-09-05 at 11:40 -0600, R B wrote: Hi, I need to create a cron job PHP script to access every day the information of a webpage that is out of my server. This webpage needs POST variables to display the information. How can i send this POST variables from my PHP script without having a html form, and receive the required information? Make a socket connection or preferrably use CURL to do the low level stuff for you. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- Under the Options and Under the Hood there's an option called: Use DNS pre-fetching to improve page load performance I think that's what I was thinking of. That's probably not pre-fetching whole pages so much as just resolving DNS ahead of time. There still could be some pre-caching going on that you just can't control. Not sure. -TG - Original Message - From: Richard Heyes [EMAIL PROTECTED] To: TG [EMAIL PROTECTED] Cc: Ovidiu Rosoiu [EMAIL PROTECTED],[EMAIL PROTECTED] Date: Fri, 5 Sep 2008 09:12:13 +0100 Subject: Re: [PHP] Google Chrome Hi, There's an option for pre-buffering things, I believe. Where? -- Richard Heyes HTML5 Graphing for IE7, FF, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Under the Options and Under the Hood there's an option called: Nope, no effect I'm afraid. -- Richard Heyes HTML5 Graphing for IE7, FF, Opera and Safari: http://www.phpguru.org/RGraph ---End Message--- ---BeginMessage--- Greetings list! Is it possible (and if so, how) to send username and password information to a website with PHP? I would like to submit some information to some network devices we have, but they require login credentials to proceed. I would like to bypass the traditional username/password prompt so I can automate the procedure. I hope this makes sense. Thanks, Jay ---End Message--- ---BeginMessage--- On Fri, 2008-09-05 at 15:01 -0500, Jay Moore wrote: Greetings list! Is it possible (and if so, how) to send username and password information to a website with PHP? I would like to submit some information to some network devices we have, but they require login credentials to proceed. I would like to bypass the traditional username/password prompt so I can automate the procedure. I hope this makes sense. If you mean http auth style login information then you do the following: http://www.somedomain.com:[EMAIL PROTECTED]/the/path/to/resource.html Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- Jay Moore wrote: Greetings list! Is it possible (and if so, how) to send username and password information to a website with PHP? In one word... CURL ---End Message--- ---BeginMessage--- On 5 Sep 2008, at 21:05, Robert Cummings wrote: On Fri, 2008-09-05 at 15:01 -0500, Jay Moore wrote: Greetings list! Is it possible (and if so, how) to send username and password information to a website with PHP? I would like to submit some information to some network devices we have, but they require login credentials to proceed. I would like to bypass the traditional username/password prompt so I can automate the procedure. I hope this makes sense. If you mean http auth style login information then you do the following: http://www.somedomain.com:[EMAIL PROTECTED]/the/path/to/resource.html I think he meant http://user:[EMAIL PROTECTED]/the/path/to/resource.html . Jay: How does the device ask for the
php-general Digest 6 Sep 2008 20:54:08 -0000 Issue 5667
php-general Digest 6 Sep 2008 20:54:08 - Issue 5667 Topics (messages 279590 through 279604): Re: Sending username/password 279590 by: Boyd, Todd M. 279593 by: Richard Heyes 279594 by: ANR Daemon 279596 by: Richard Heyes 279603 by: ANR Daemon Evaluating script complexity 279591 by: Reese 279597 by: Robert Cummings Problem of Connection Character Sets and Collations 279592 by: edwardspl.ita.org.mo Length of Exception text? 279595 by: ANR Daemon Re: fsockopen in phpmailer and tls 279598 by: Larry Brown 279599 by: Robert Cummings 279600 by: Larry Brown 279601 by: Robert Cummings Path of the class file of an object 279602 by: Ali Çevik 279604 by: ANR Daemon 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] -- ---BeginMessage--- -Original Message- From: Jay Moore [mailto:[EMAIL PROTECTED] Sent: Fri 9/5/2008 3:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Sending username/password Wolf wrote: Jay Moore wrote: Greetings list! Is it possible (and if so, how) to send username and password information to a website with PHP? In one word... CURL A couple of people have responded (to me; not the list) with that very same response. I've heard of it, but never used it before. Care to give me the 30 second rundown [I can read the site, sure, but it's probably easier if you explained it :) ]? Is it like a glorified socket connection or something? Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Seriously... you should just read the site. It's a library that mimics browser behavior. It will follow Location: headers, push POST variables, etc. Why not just give the page a glance? http://us3.php.net/manual/en/intro.curl.php -Todd ---End Message--- ---BeginMessage--- Seriously... you should just read the site. It's a library that mimics browser behavior. It will follow Location: headers, push POST variables, etc. Why not just give the page a glance? http://us3.php.net/manual/en/intro.curl.php If you don't have access to Curl, you could also look at the PEAR HTTP_Request class. IIRC this supports HTTP Basic authentication. -- Richard Heyes HTML5 Graphing for IE7, FF, Opera and Safari: http://www.phpguru.org/RGraph ---End Message--- ---BeginMessage--- Greetings, Richard Heyes. In reply to Your message dated Saturday, September 6, 2008, 18:53:31, Seriously... you should just read the site. It's a library that mimics browser behavior. It will follow Location: headers, push POST variables, etc. Why not just give the page a glance? http://us3.php.net/manual/en/intro.curl.php If you don't have access to Curl, you could also look at the PEAR HTTP_Request class. IIRC this supports HTTP Basic authentication. I'd recommend HTTP_Client in that case. -- Sincerely Yours, ANR Daemon [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- I'd recommend HTTP_Client in that case. You could, but that uses HTTP_Request by the looks of it. -- Richard Heyes HTML5 Graphing for IE7, FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph ---End Message--- ---BeginMessage--- Greetings, Richard Heyes. In reply to Your message dated Saturday, September 6, 2008, 21:26:25, I'd recommend HTTP_Client in that case. You could, but that uses HTTP_Request by the looks of it. You're right, but HTTP_Client offers some additional tools to, as you said, mimicking web browsers behaviour. Including cookies handling. -- Sincerely Yours, ANR Daemon [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Good morning everyone, I've usually taken a dive-in/head-first approach to the things I've engaged in, more and more lately I've come to realize that this approach is not always appropriate. I believe this realization can be called experience. So, I have a question I hoped the group could help me with. While it is generally applicable to programming in any language, I am asking with specific regard to PHP. When a customer, client or supervisor presents with task description, how is that tasking rated for complexity? By how many functions are involved? My how many logic decisions must be performed? A combination? Now throw in a time factor. What if your ability would have you completing it in 12 hours but they want it in 6? Or 4? Are there guidelines for helping someone new at these types of evaluations? Or is it all based on experience and familiarity with past accomplishments? Given the nature of this tasking (a coding challenge) how likely is it that they do not really expect a finished product but wanted to see how far a person got with it? If that, is 16 hours (overnight)
Re: [PHP] Google Chrome
Under the Options and Under the Hood there's an option called: Nope, no effect I'm afraid. -- Richard Heyes HTML5 Graphing for IE7, FF, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sending username/password
-Original Message- From: Jay Moore [mailto:[EMAIL PROTECTED] Sent: Fri 9/5/2008 3:23 PM To: php-general@lists.php.net Subject: Re: [PHP] Sending username/password Wolf wrote: Jay Moore wrote: Greetings list! Is it possible (and if so, how) to send username and password information to a website with PHP? In one word... CURL A couple of people have responded (to me; not the list) with that very same response. I've heard of it, but never used it before. Care to give me the 30 second rundown [I can read the site, sure, but it's probably easier if you explained it :) ]? Is it like a glorified socket connection or something? Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Seriously... you should just read the site. It's a library that mimics browser behavior. It will follow Location: headers, push POST variables, etc. Why not just give the page a glance? http://us3.php.net/manual/en/intro.curl.php -Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Evaluating script complexity
Good morning everyone, I've usually taken a dive-in/head-first approach to the things I've engaged in, more and more lately I've come to realize that this approach is not always appropriate. I believe this realization can be called experience. So, I have a question I hoped the group could help me with. While it is generally applicable to programming in any language, I am asking with specific regard to PHP. When a customer, client or supervisor presents with task description, how is that tasking rated for complexity? By how many functions are involved? My how many logic decisions must be performed? A combination? Now throw in a time factor. What if your ability would have you completing it in 12 hours but they want it in 6? Or 4? Are there guidelines for helping someone new at these types of evaluations? Or is it all based on experience and familiarity with past accomplishments? Given the nature of this tasking (a coding challenge) how likely is it that they do not really expect a finished product but wanted to see how far a person got with it? If that, is 16 hours (overnight) excessive? How many of us are willing to stay up all night on a coding challenge for a prospective employer with no promise of being hired? The reason I ask, I saw tasking to create a loan repayment calendar (or calculator). So basically, all the usual complexity of a calendar (or calculator), then calculate weekends and holidays, and shift the paydate to the left as needed to not fall on one of those. Now figure that the usual time to complete this task (just the processing script, not a GUI for it) is claimed to be 3-4 hours (but 16 hours are given). So while I want to know how to rate tasking complexity more generally, at root I'm wondering what degree of proficiency (with PHP) must a programmer have to complete this sort of task in those sorts of time frames. Reese -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem of Connection Character Sets and Collations
Dear All, For displaying with unicode Character Sets problem : MySQL : Command line of mysqldump and mysql : Which command line is right ? 1, --default-character-set=utf8 2, --default-character-set=utf-8 phpmyadmin : The Connection Character Sets and Collations setting : Which command line is right ? 1, utf8_bin 2, utf8_general_ci 3, utf8_unicode_ci php : Which command line is right ? 1, mysql_query(SET NAMES utf8); 2, mysql_query(SET NAMES utf-8); Many thank for your help ! Edward. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending username/password
Seriously... you should just read the site. It's a library that mimics browser behavior. It will follow Location: headers, push POST variables, etc. Why not just give the page a glance? http://us3.php.net/manual/en/intro.curl.php If you don't have access to Curl, you could also look at the PEAR HTTP_Request class. IIRC this supports HTTP Basic authentication. -- Richard Heyes HTML5 Graphing for IE7, FF, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Sending username/password
Greetings, Richard Heyes. In reply to Your message dated Saturday, September 6, 2008, 18:53:31, Seriously... you should just read the site. It's a library that mimics browser behavior. It will follow Location: headers, push POST variables, etc. Why not just give the page a glance? http://us3.php.net/manual/en/intro.curl.php If you don't have access to Curl, you could also look at the PEAR HTTP_Request class. IIRC this supports HTTP Basic authentication. I'd recommend HTTP_Client in that case. -- Sincerely Yours, ANR Daemon [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Length of Exception text?
Greetings, All. I've been working on some PEAR-based app last week and I ran into problem. While I debugging app, my backtrace always trimmed at some point. First time I though it was my mistake, and switched back to standard Exception class. But nothing changed. If I print everything by hands, it's all full and good, but if I let PHP print exception message, it getting trimmed at 1015 characters, rendering backtrace almost useless. Say, only my own code producing 4-5 lines, PEAR stuff adding about 8, plus converting PEAR_Error to Exception at least 2 lines. All-in-all, up to 15 lines so far, and backtrace trimmed at 6'th or 7'th line. Is there any way to affect this behaviour without recompiling PHP? -- Sincerely Yours, ANR Daemon [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Sending username/password
I'd recommend HTTP_Client in that case. You could, but that uses HTTP_Request by the looks of it. -- Richard Heyes HTML5 Graphing for IE7, FF, Chrome, Opera and Safari: http://www.phpguru.org/RGraph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Evaluating script complexity
On Sat, 2008-09-06 at 10:05 -0500, Reese wrote: but wanted to see how far a person got with it? If that, is 16 hours (overnight) excessive? I spend 16 hours at a time sometimes just pursuing something I found interesting while eating my lunch... your mileage may vary. INTP for life baby! Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Fri, 2008-09-05 at 00:58 -0400, Robert Cummings wrote: On Thu, 2008-09-04 at 23:20 -0400, Larry Brown wrote: I am having a ball of a time trying to figure this one out... If anyone has dealt with this before I'd love to get some morsels of wisdom from you... I am trying to connect to a postfix server I have set up remotely using smtp auth with tls. The postfix appears to be configured correctly at this point. I can telnet to port 25 and it will list tls as an option as the howto describes it should. I try to connect from php and get: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I've googled this and someone seems very knowledgeable about it yet describes the solution in a way that a mere mortal like myself can't follow. He states in part: Look at the error message: error:1408F10B:SSL routines:func(143):reason(267) Take the reason code (267) and determine the error: grep 267 /usr/include/openssl/ssl.h /usr/include/openssl/ssl.h:#define SSL_R_WRONG_VERSION_NUMBER 267 Now google for SSL_R_WRONG_VERSION_NUMBER... ...So in your server method configuration you must put: SSL_CTX *ctx = SSL_CTX_new (SSLv23_server_method()) to correctely analyse the first client_hello message instead of SSL_CTX *ctx = SSL_CTX_new (SSLv3_server_method()) which i suppose you did So is he talking about modifying the source code in postfix and rebuilding it? Have any of you guys dealt with this?... By the way, when I started out I had a typo in the postfix config for the path to the certificates for ssl and was getting the same error message. It wasn't until I saw in the postfix mail log that it couldn't read the cert. So that was fixed but I continue to get the same message which I'm now thinking might be a red herring. Possibly a complete waste of your time... but maybe you need to configure this setting: smtp_tls_mandatory_protocols http://www.postfix.org/postconf.5.html Cheers, Rob. -- OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Sat, 2008-09-06 at 14:02 -0400, Larry Brown wrote: OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? Sounds like an email client issue and most likely may differ for each and every one of them. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Sat, 2008-09-06 at 14:06 -0400, Robert Cummings wrote: On Sat, 2008-09-06 at 14:02 -0400, Larry Brown wrote: OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? Sounds like an email client issue and most likely may differ for each and every one of them. Cheers, Rob. -- I am the email client. In this case which is what I'm trying to figure out. The script fails with the original string I posted: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I'm using the smtpmailer class and it is trying to execute fsockopen. So to simplify troubleshooting I used the following code: if(fsockopen(tls://serverName,25,$errno,$errstr, 30)) { echo Made it!\n; } else { echo Nope!\n; echo $errno.\n; echo $errstr.\n; } I get the above warning from PHP and $errno has 0 as a value and there is $errstr is empty. PHP is v5.2.6 and phpinfo shows that ssl and tls support are both compiled in. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Sat, 2008-09-06 at 14:38 -0400, Larry Brown wrote: On Sat, 2008-09-06 at 14:06 -0400, Robert Cummings wrote: On Sat, 2008-09-06 at 14:02 -0400, Larry Brown wrote: OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? Sounds like an email client issue and most likely may differ for each and every one of them. Cheers, Rob. -- I am the email client. In this case which is what I'm trying to figure out. The script fails with the original string I posted: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I'm using the smtpmailer class and it is trying to execute fsockopen. So to simplify troubleshooting I used the following code: if(fsockopen(tls://serverName,25,$errno,$errstr, 30)) { echo Made it!\n; } else { echo Nope!\n; echo $errno.\n; echo $errstr.\n; } I get the above warning from PHP and $errno has 0 as a value and there is $errstr is empty. PHP is v5.2.6 and phpinfo shows that ssl and tls support are both compiled in. Ah, I see, I misunderstood when you mentioned Evolution. Sorry, I can't really help you, you're in foreign territory to me :/ Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Path of the class file of an object
Dear all, 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, Ali Çevik
Re[4]: [PHP] Sending username/password
Greetings, Richard Heyes. In reply to Your message dated Saturday, September 6, 2008, 21:26:25, I'd recommend HTTP_Client in that case. You could, but that uses HTTP_Request by the looks of it. You're right, but HTTP_Client offers some additional tools to, as you said, mimicking web browsers behaviour. Including cookies handling. -- Sincerely Yours, ANR Daemon [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Path of the class file of an object
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 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Path of the class file of an object
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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Path of the class file of an object
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/
[PHP] Re: Geometrical library
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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re[2]: Path of the class file of an object
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] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Geometrical library
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php