[PHP] How to prevent DomDocument from adding a !DOCTYPE.
Hello there, Im using DomDocument currently and i realy want to prevent it from adding the !DOCTYPE and mabye even and etc.. Is this possible and how? Thx in advance. Mathijs. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000703-1, 01/15/2007 Tested on: 1/16/2007 3:37:11 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to prevent DomDocument from adding a !DOCTYPE.
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-16 15:37:09 +0100: Im using DomDocument currently and i realy want to prevent it from adding the !DOCTYPE and mabye even and etc.. Is this possible and how? Doesn't DOMDocument *require* DTD? I thought it's either that or a "document fragment" (which is probably what you're looking for). And how should i do this? Do you have any example avelable? Thx. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000703-2, 01/16/2007 Tested on: 1/16/2007 8:42:48 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to look for unused methods/functions and variables/constants.
Hello there, We have a large project with lots of classes. Now i am wondering if there is a way to let something check all those files and tell me which methods/functions variables/constants etc.. arn't used anymore. Or even which files arn't used anymore. Is there already something like this? Thx in advance. Mathijs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap_open() error. (Can't open mailbox)
Hello there, i use imap to read incoming mail from the the SMTP server. On the live server everythings works as it should. I can use imap_open('/path/to/file', '', ''), to read just one raw-mail. On my test env i can't get this to work. I get the error message: "Can't open mailbox". While on the live server it works and i get the correct resource "resource(42) of type (imap)". I realy don't know what the problem is. Can someone help me with this? Thanks in advance. Mathijs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_open() error. (Can't open mailbox)
Thijs Lensselink wrote: Quoting Mathijs van Veluw <[EMAIL PROTECTED]>: Hello there, i use imap to read incoming mail from the the SMTP server. On the live server everythings works as it should. I can use imap_open('/path/to/file', '', ''), to read just one raw-mail. On my test env i can't get this to work. I get the error message: "Can't open mailbox". While on the live server it works and i get the correct resource "resource(42) of type (imap)". I realy don't know what the problem is. Can someone help me with this? Thanks in advance. Mathijs. I didn't work with IMAP much. So one suggestion could be to check if your dev box is behind a proxy server. If you're using SSL check if it's enabled on your dev box. the imap_open() only gets a file location. This file containts a raw-mail, so no need for ssl or proxy stuff etc.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_open() error. (Can't open mailbox)
Thijs Lensselink wrote: Quoting Mathijs van Veluw <[EMAIL PROTECTED]>: Thijs Lensselink wrote: Quoting Mathijs van Veluw <[EMAIL PROTECTED]>: Hello there, i use imap to read incoming mail from the the SMTP server. On the live server everythings works as it should. I can use imap_open('/path/to/file', '', ''), to read just one raw-mail. On my test env i can't get this to work. I get the error message: "Can't open mailbox". While on the live server it works and i get the correct resource "resource(42) of type (imap)". I realy don't know what the problem is. Can someone help me with this? Thanks in advance. Mathijs. I didn't work with IMAP much. So one suggestion could be to check if your dev box is behind a proxy server. If you're using SSL check if it's enabled on your dev box. the imap_open() only gets a file location. This file containts a raw-mail, so no need for ssl or proxy stuff etc.. It doesn't give a file location. it creates a resource. This resource you can use to retrieve the data. SSL is no option like you said. I would at least check the proxy. I'm behind a proxy here also. And for remote communication i use a proxy class. Maybe somebody else on the list can point you in the right direction. Ill explain it a bit more better. I have a file with something like the contents at the bottom (without the --). Now on my live server i can use: . This works like a charm, and i can use that resource to extract the information of that contents of that file. Now if i use that same script on my test server, it doesn't work anymore. And i get the following error: "Warning: imap_open() [function.imap-open]: Couldn't open stream /path/to/file-with-contents-at-bottom in ...". This file is located (for example) in the document_root of the web server. While on the live server the $imapResource is an 'resource(42) of type (imap)'. So i wonder how i can fix this imap_open() problem. Im sorry if i don't understand your response very well if that could be the solution. Thx in advanced. --- Delivered-To: [EMAIL PROTECTED] Received: by 10.0.0.1 with SMTP id x; Sun, 8 Jun 2008 02:00:12 -0700 (PDT) Received: by 10.0.0.1 with SMTP id xxx.; Sun, 08 Jun 2008 02:00:11 -0700 (PDT) Return-Path: <[EMAIL PROTECTED]> Received: from smtp.mail.com (smtp.mail.com [10.0.0.1]) by mx.mail.com with ESMTP id xxx.2; Sun, 08 Jun 2008 02:00:11 -0700 (PDT) Received: from 10.0.0.1 (smtp.mail.com [10.0.0.1]) by smtp.mail.com (8.13.1/8.13.1) with SMTP id xx for [EMAIL PROTECTED]; Sun, 8 Jun 2008 11:00:05 +0200 Date: Sun, 8 Jun 2008 11:00:05 +0200 Message-Id: <[EMAIL PROTECTED]> Reply-To: name <[EMAIL PROTECTED]> From: from <[EMAIL PROTECTED]> To: to <[EMAIL PROTECTED]> Subject: Subject Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 This is my mail blah blah blah Blah blah blah blah foobar etc.. etc... --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_open() error. (Can't open mailbox)
Edward Kay wrote: -Original Message- From: Thijs Lensselink [mailto:[EMAIL PROTECTED] Sent: 09 June 2008 13:43 To: php-general@lists.php.net Subject: Re: [PHP] imap_open() error. (Can't open mailbox) Quoting Mathijs van Veluw <[EMAIL PROTECTED]>: Thijs Lensselink wrote: Quoting Mathijs van Veluw <[EMAIL PROTECTED]>: Hello there, i use imap to read incoming mail from the the SMTP server. On the live server everythings works as it should. I can use imap_open('/path/to/file', '', ''), to read just one raw-mail. On my test env i can't get this to work. I get the error message: "Can't open mailbox". While on the live server it works and i get the correct resource "resource(42) of type (imap)". I realy don't know what the problem is. Can someone help me with this? Thanks in advance. Mathijs. I didn't work with IMAP much. So one suggestion could be to check if your dev box is behind a proxy server. If you're using SSL check if it's enabled on your dev box. the imap_open() only gets a file location. This file containts a raw-mail, so no need for ssl or proxy stuff etc.. Have you checked the permissions on the mail file? Are your dev and live boxes both running PHP in the same manner (Apache module vs CGI)? Can you open the same file with fopen? Edward The file is accessable, and they both run using the apache2 module etc.. Both have the same version PHP and same IMAP version. So i find it strange. For the output see my last post. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with rawurlencode and euro sign.
Thx for that website :). It helped. I Think the server i am sending to is on windows, and i changed the encoding to windows-1252 and that has it on %80. Going to contact the company to ask this :). Thx for the link. Jochem Maas wrote: likely to be something to do with the fact that the euro character does not exist in ISO8859-1. maybe this page helps: http://www.gar.no/html/euro.htm Mathijs wrote: Hello there, I have a problem with rawurlencode(). I want to have the euro sign € to be sent by post. To do this, first rawurlencode() encodes all the chars. But for some reason rawurlencode encodes it to %3F or %A4. Which i think is logical becouse that is the right position in the charset. But i need it to be %80. When i use rawurldecode('%80'); and put the browsers encoding to ISO-8859-* it does work. i Realy see the euro sign. So why does rawurlencode() not encodes it tho this?. Thx in advance. Mathijs. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0630-2, 07/26/2006 Tested on: 7/27/2006 12:20:37 PM avast! - copyright (c) 1988-2006 ALWIL Software. http://www.avast.com --- avast! Antivirus: Inbound message clean. Virus Database (VPS): 0630-2, 07/26/2006 Tested on: 7/27/2006 12:43:09 PM avast! - copyright (c) 1988-2006 ALWIL Software. http://www.avast.com --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0630-2, 07/26/2006 Tested on: 7/27/2006 12:50:09 PM avast! - copyright (c) 1988-2006 ALWIL Software. http://www.avast.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is there a list of all Timezones as an array or someting?
Hello there, I need to have a selectbox filled with the available timezones of PHP. We are using v5.1.x, and it supports the date_default_timezone_set() etc.. As value you can give a string to what timezone. I want all these strings within an array or something so i can create a selectbox so users can select it. Thx in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a list of all Timezones as an array or someting?
Christopher Watson wrote: Might also want to have a look-see at the Date_TimeZone class of the PEAR::Date package. It seems pretty comprehensive with regard to time zone coverage. -Christopher Thx.. i take a look at that.. But we have a strict rule. No PHP4 only PHP5 OO. So that is not queite the option. I Do have a list of all options that date_default_timezone_set() excepts. So i think i am going to use that as my options where the user can select there right zone. This will work with Daylight savings etc.. So i don't have to count for that. Thx for the help :). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do i extract a function call with arguments from a source file?
Hello there, Is there a way to extract a function call with its arguments? Like i have something like this: =CODE== =CODE== Now i want to extract the ClassName::FunctionName() part, inculding its arguments. The first two arguments are required, the last two/three arn't. How can i extract/match/replace this part? Thx in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
Hello there, I have an shutdown function to catch fatal-errors etc.. Now when there is an exit() somewhere i get an empty message from get_last_error(). I want to know the location of this exit() or die(). Is there a way to get the file and line-number from where the exit/die originated? Thx in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i get the location of an exit()/die() from withinregister_shutdown_function()?
Chris wrote: Mathijs van Veluw wrote: Hello there, I have an shutdown function to catch fatal-errors etc.. Now when there is an exit() somewhere i get an empty message from get_last_error(). I want to know the location of this exit() or die(). Is there a way to get the file and line-number from where the exit/die originated? debug_backtrace ? This won't work from within the register_shutdown_function() function. This because the scope is cleared, and the debug_backtrace starts from within the register_shutdown_function() function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
Eric Butera wrote: On Wed, Jul 16, 2008 at 3:23 AM, Mathijs van Veluw <[EMAIL PROTECTED]> wrote: Hello there, I have an shutdown function to catch fatal-errors etc.. Now when there is an exit() somewhere i get an empty message from get_last_error(). I want to know the location of this exit() or die(). Is there a way to get the file and line-number from where the exit/die originated? Thx in advance. The way I handle this is by throwing exceptions in my code. So let's say that there is a db connection/query failure for whatever reason. Instead of using query() or die() which is not user friendly, I throw an exception which bubbles up. Once it hits the top then I can catch it, log it accordingly, and show the user a friendlier error page saying Oops! With an exception you get exactly what you want, a full-blown stack trace complete with paths, line numbers etc. You also get the ability to be graceful about what you show to the end user. ...but I have the feeling that you're already dealing with a situation in lots of existing code. Perhaps you could combine some suggestions in this thread and replace your die/exit statements with a custom function which logs a debug_backtrace() and then really dies, but gracefully of course. :) As an aside, if I were to see some jibberish about a query and line numbers when I click a link I'd leave that site. (And for the archives) It is a security vuln to show full file paths to an end user. If someone is tampering with your system we shouldn't give them any more information than they can already get. Well i don't use 'OR die()' stuff. But exceptions. For some reason from within the register_shutdown_function() function i get an empty error message. This only occurs, as far as i know, when there is an exit somewhere. I want to trace where this comes from. But i think that this isn't possible, as i looked on the web and there arn't any solutions. Thx for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i get the location of an exit()/die() from within register_shutdown_function()?
Eric Butera wrote: On Wed, Jul 16, 2008 at 9:41 AM, Mathijs van Veluw <[EMAIL PROTECTED]> wrote: Well i don't use 'OR die()' stuff. But exceptions. For some reason from within the register_shutdown_function() function i get an empty error message. This only occurs, as far as i know, when there is an exit somewhere. I want to trace where this comes from. But i think that this isn't possible, as i looked on the web and there arn't any solutions. Thx for the help. Well if this is a very specific issue that you're trying to resolve perhaps you could try and figure out how the user triggered the error. You could just save the remote address and request uri, do some access log searching and re-produce the path the user took through your site. This has been a helpful technique for me several times. One of the main problems for me is that I know how to use the systems I build, so I wouldn't click on stuff in the weird order some users do. Well it is an cronjobed php script that executs several other scripts depending on the time. Something within those cronjobs triggers the shutdown function without an exit, which i find very strange. I think i have to debug it to trace the exact steps what its doing, because there is no exit within that script. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php