php-general Digest 7 Apr 2010 14:49:50 -0000 Issue 6680

Topics (messages 303864 through 303874):

Re: SimpleXMLElement occasionally fails to parse gb2312 or big5 feeds
        303864 by: Dan Joseph

Re: Logical reason for strtotime('east') and strtotime('west') returning valid 
results?
        303865 by: Kevin Kinsey
        303869 by: Peter Lind

Re: no-cache control
        303866 by: kranthi
        303867 by: Karl DeSaulniers

Re: $_SERVER['PHP_AUTH_USER'] has gone
        303868 by: Satz Klauer

Re: image question again
        303870 by: Ashley Sheridan

Who uses Mantis, please help!
        303871 by: Andre Polykanine
        303872 by: Paul M Foster

stat(), NFS shares and local files timeout
        303873 by: Igor Feghali
        303874 by: Dan Joseph

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Fri, Apr 2, 2010 at 10:28 AM, Peter Pei <peterpei...@hotmail.com> wrote:

>
> I use the following code to get rss and parse it, but the code occasionally
> have issues with gb2312 or big-5 encoded feeds, and fails to parse them.
> However other times may appear just okay. Any thoughts? Maybe
> SimpleXMLElement is simply not meant for other language encodings...
>
>                $page = file_get_contents($rss);
>                try {
>                        $feed = new SimpleXMLElement($page);
>
>
>
I've been learning a bit about SimpleXML today myself.  It seems that it
misses a lot of things when it comes to complex, or abnormal XML.  Abnormal
being what you're describing and whatnot.  I don't really have a solid
answer for you (Just noticed no one  responded), but I think you're running
into what I was...  Its just built to be Simple, not expand its mind.

Hope that helps!

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code "NEWTHINGS" for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry

--- End Message ---
--- Begin Message ---
Colin Guthrie wrote:
'Twas brillig, and Kevin Kinsey at 05/04/10 19:15 did gyre and gimble:
Nonetheless, I'm suspecting the programmers had something
like this in mind.

Yeah I guess that's why it interprets these terms. Good thinking :)

Isn't strtotime() based on some GNU utility?

Yeah, that's why I said "the relevant authorities". I couldn't remember
off-hand where it came from so figured I'd not blame "PHP" just yet :p

Apparently these strings are being recognized as TZ stamps, but the underlying
logic is "not fully implemented": see
http://www.gnu.org/s/libc/manual/html_node/Low_002dLevel-Time-String-Parsing.html

Try it with some TZ stamps ... I'm pretty sure that in the previous
example it was taking "East" to be "EST", as I observed (rather by
accident) earlier.

Kevin Kinsey

--- End Message ---
--- Begin Message ---
On a related note: does anyone know why

php -r "echo date('Y-m-d H:i:s', strtotime('a'));"

happily outputs a valid timestamp? And why all other letters work as
well (but only one character)? I'm sure there's a good reason for it,
it just completely escapes me right now :)

Regards
Peter

-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
</hype>

--- End Message ---
--- Begin Message ---
you can do that by using .htacess in the required directory
http://www.askapache.com/htaccess/apache-speed-cache-control.html

--- End Message ---
--- Begin Message ---
Thanks kranthi. I thought there was a way.
I was thinking you could, say, set your header content in the php.ini file?, but a .htaccess would work too.
Thanks,
Best,

Karl

On Apr 6, 2010, at 11:44 PM, kranthi wrote:

you can do that by using .htacess in the required directory
http://www.askapache.com/htaccess/apache-speed-cache-control.html

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


Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---
Yes, the authantication-box is there. And I'm definitely using Basic
auth, the same script has worked for a long time without problems.

On 4/7/10, Nilesh Govindarajan <li...@itech7.com> wrote:
> On 04/06/10 21:27, Satz Klauer wrote:
>> var_dump($_SERVER) gives me several data, the following arrayindices
>> contain
>> data:
>>
>> "HTTPS", "SSL_TLS_SNI", "HTTP_USER_AGENT", "HTTP_HOST", "HTTP_ACCEPT",
>> "HTTP_ACCEPT_LANGUAGE", "HTTP_ACCEPT_CHARSET", "HTTP_ACCEPT_ENCODING",
>> "HTTP_REFERER", "HTTP_COOKIE", "HTTP_COOKIE2", "HTTP_CONNECTION",
>> "HTTP_TE",
>> "PATH", "SERVER_SIGNATURE", "SERVER_SOFTWARE", "SERVER_NAME",
>> "SERVER_ADDR",
>> "SERVER_PORT", "REMOTE_HOST", "REMOTE_ADDR", "DOCUMENT_ROOT",
>> "SERVER_ADMIN", "SCRIPT_FILENAME", "REMOTE_PORT", "GATEWAY_INTERFACE" =>
>> string(7) "CGI/1.1" (??? it is running as apache-module ???,
>> "SERVER_PROTOCOL", "REQUEST_METHOD", "QUERY_STRING", "REQUEST_URI",
>> "SCRIPT_NAME", "PHP_SELF", "REQUEST_TIME"
>>
>> Unfortunately not Auth-data.
>>
>> var_dump($_ENV) tells me (partially anonymised):
>>
>> ["HOSTNAME"]=>  string(24) "xxx.yyy.de"
>> ["TERM"]=>  string(5) "xterm"
>> ["SHELL"]=>  string(9) "/bin/bash"
>> ["HISTSIZE"]=>  string(4) "1000"
>> ["QTDIR"]=>  string(15) "/usr/lib/qt-3.3"
>> ["QTINC"]=>  string(23) "/usr/lib/qt-3.3/include"
>> ["USER"]=>  string(4) "root"
>> ["LS_COLORS"]=>  string(1268)
>> "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01
> ;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:"
>>
>> ["MC_TMPDIR"]=>  string(12) "/tmp/mc-root"
>> ["PATH"]=>  string(29) "/sbin:/usr/sbin:/bin:/usr/bin"
>> ["MAIL"]=>  string(20) "/var/spool/mail/root"
>> ["PWD"]=>  string(17) "/etc/xxx/yyy"
>> ["LANG"]=>  string(1) "C"
>> ["HISTCONTROL"]=>  string(11) "ignorespace"
>> ["HOME"]=>  string(5) "/root"
>> ["SHLVL"]=>  string(1) "4"
>> ["MC_SID"]=>  string(5) "25229"
>> ["LOGNAME"]=>  string(4) "root"
>> ["CVS_RSH"]=>  string(3) "ssh"
>> ["QTLIB"]=>  string(19) "/usr/lib/qt-3.3/lib"
>> ["LESSOPEN"]=>  string(24) "|/usr/bin/lesspipe.sh %s"
>> ["G_BROKEN_FILENAMES"]=>  string(1) "1" ["_"]=>  string(15)
>> "/usr/sbin/httpd"
>>
>>
>>
>> On Sun, Apr 4, 2010 at 10:54 PM, Daniel P. Brown
>> <daniel.br...@parasane.net>wrote:
>>
>>> Sorry for the top-post. Easter has me on the DROID instead of my PC.
>>>
>>> I second Rixham's thought. Is it a DSO, CGI, FCGI? What pops out in
>>> var_dump($_SERVER) and var_dump($_ENV)?
>>>
>>> On Apr 4, 2010 3:49 PM, "Nathan Rixham"<nrix...@gmail.com>  wrote:
>>>
>>> Satz Klauer wrote:
>>>> Hi,
>>>>
>>>> I'm running a system with Fedora 12 and Apache/PHP default
>>>> installatio...
>>> just a quick sanity check; you do have the specific site/directory set
>>> up to send and receive basic auth yeah? sounds very much to me like this
>>> is an apache config issue and not php :)
>>>
>>> regards!
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub....
>>>
>>>
>>
>
> This means that something is wrong with your script or server which is
> not sending the Auth headers properly. Do you get the auth box in the
> latest browser, and are you sure that you're using basic and not digest
> auth ?
>
> --
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.com
> मेरा भारत महान !
> मम भारत: महत्तम भवतु !
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Tue, 2010-04-06 at 21:44 -0500, Karl DeSaulniers wrote:

> When I have an imagecreatetruecolor and I create another one and use  
> imagecopymerge, how do I keep the backgrounds transparent even if say  
> the width of the top image is smaller than the back image?
> I keep getting a black background where the top image does not cover  
> the back. It sets the transparency to the rest of the top image as  
> long as it is covering the bottom one. I think it has to do with the  
> imagealphablending.
> Any ideas?
> TIA
> 
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
> 


If it's just that the images are different sizes, then imagecopyresample
might be the better option.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hello everyone,
I decided to use Mantis before I'll be able to use something like Trac
:-).
The problem is: I'm not getting mail about issues reported by my
testers, only by myself. The preferences are set correctly (all the
checkboxes are checked).
Could you help me please?
Thanks!


-- 
With best regards from Ukraine,
Andre
Http://oire.org/ - The Fantasy blogs of Oire
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: http://twitter.com/m_elensule


--- End Message ---
--- Begin Message ---
On Wed, Apr 07, 2010 at 03:37:07PM +0300, Andre Polykanine wrote:

> Hello everyone,
> I decided to use Mantis before I'll be able to use something like Trac
> :-).
> The problem is: I'm not getting mail about issues reported by my
> testers, only by myself. The preferences are set correctly (all the
> checkboxes are checked).
> Could you help me please?
> Thanks!

Isn't there a Mantis list or forum?

Paul

-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---
I am running with an issue with remote filesystems (mounted via NFS)
and PHP's stat() / filemtime().

Sometimes when the remote filesystem (NFS share) is busy, my PHP
daemon just hangs forever on a filemtime() call to a file inside this
FS. I failed to find a proper way of setting a timeout for that kind
of operation. Everything I can think of is related to remote files
(URLs) and/or content operations (read/write). Streams for example,
don't even have any options for "local" files and
"default_socket_timeout" directive is applicable only for sockets.

I could fork my daemon just to do a stat() call and control the
running time (timeout) inside the parent process, but I usually stat
60 files / second, so that would be a lot of forking. I prefer to go
another way. anyone has a clue ?

PS: I appreciate if replies go CC'ed to me

Best,
~IF.

--- End Message ---
--- Begin Message ---
On Wed, Apr 7, 2010 at 10:27 AM, Igor Feghali <igor.fegh...@gmail.com>wrote:

> I am running with an issue with remote filesystems (mounted via NFS)
> and PHP's stat() / filemtime().
>
> Sometimes when the remote filesystem (NFS share) is busy, my PHP
> daemon just hangs forever on a filemtime() call to a file inside this
> FS. I failed to find a proper way of setting a timeout for that kind
> of operation. Everything I can think of is related to remote files
> (URLs) and/or content operations (read/write). Streams for example,
> don't even have any options for "local" files and
> "default_socket_timeout" directive is applicable only for sockets.
>
> I could fork my daemon just to do a stat() call and control the
> running time (timeout) inside the parent process, but I usually stat
> 60 files / second, so that would be a lot of forking. I prefer to go
> another way. anyone has a clue ?
>
What if you simply set the script to time out?  Is it ignoring that too?
set_time_limit( seconds )

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code "NEWTHINGS" for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry

--- End Message ---

Reply via email to