| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
Comments:
<0> he needs ['extension'] <0> how do you set up casting behaviour for your objects? I'm not PHP 5 savvy <1> Ciaran: You don't. <1> Zend handles that <2> TML: at least i might be able to come up with something that will help someone else solve the real issue <0> actually he should just use PATHINFO_EXTENSION <3> so path = pathinfo($_FILES['pic']['name']) <0> oh..so where does the int come from? <3> and then path['extension'] <1> Ciaran: Z_OBJ_HT_P(op)->cast_object <0> if you do pathinfo(filename, PATHINFO_EXTENSION) <0> it will return the extension <0> http://bugs.php.net/bug.php?id=33999 <1> Ciaran: Yes <1> That's part of the issue we're discussing <0> sorry, thought you'd just discovered the bug
<2> TML: all i have to do is diff the cast_object from 5.0.4 and 5.1.3RC and i should be able to see if anything's changed/come unstuck <1> Ciaran: No, we're discussing it <4> hi <3> thanks :) <4> 8-) <5> so, here's an example of broken nested output buffering with virtual : http://www.owid.org/php/test_ob.php <5> there could easily be something I'm not understanding. <1> earth: Wait...what does virtual() have to do with output buffering? <1> earth: Note that it's never been considered a terribly good idea to request PHP scripts using virtual() <5> right, it is effectively broken all the way around <5> but, it totally borks ob <1> It doesn't just bork OB. It borks the entire engine. <5> so, anyway, that's an example of one of the problems with ob :) <5> if the call shouldn't be used, it should be removed from the source. I've never understood why it doesn't actually generate a new httpd call. <1> earth: It's not a problem with OB, it's a problem with vortual. <5> heh <1> s/vor/vir/ <1> The call can be used, but it shouldn't be used to call another instance of the PHP engine, because bad things can happen <5> you note that there is no indication of that in the documentation. <5> but, either way, I don't need to argue about it <5> there are a couple of main problems i have with virtual and one of them is ob <6> is it something that can't be done with include() or require()? <5> it really ought to just throw it out as a real httpd request, don't try to do smart twisty internal things. make a new hit to httpd. but whatever, I had this argument about 4 years ago with php devs :) <5> I don't need to go back over it. <1> earth: If you want a real httpd request, use include <1> include 'http://...'; will do precisely that <5> my more recent minor issue was line returns with XML bits parsed and then using appendChild: http://www.owid.org/php/test_dom.php <1> virtual is there specifically for the "smarty twisty internal things" that include doesn't cover <5> right, except it is borked :) <1> earth: Yes, it has bugs. Mainly because no one uses it, so no one can fix the bugs. <5> it is not always possible to easily avoid calling php scripts. shtml include virtual was a sort of duct tape solution that works wonders <1> I don't understand what you mean by that. <5> one of the sites I run has tomcat, zope, php, perl, text files, shtml files, remote SOAP crap.. all barely held together. I often have no idea what the next layer down is doing. <5> well, php's virtual is an attempted copy of shtml include virtual <5> and that allows one to drop subrequests in that save the environment and can grab output from another cgi or server applet <5> s/save/same/ <5> anyway, understood. it is little used and kinda broken. I drop it. <5> I don't mean to pick a fight, was just showing the example code I wrote to show the problem I have. <1> earth: I just want to make sure it's clear: there's not a problem in OB, there's a problem in virtual. You haven't demonstrated a problem in OB that I can see. <5> heh <5> now you're picking the fight ;] <5> ob breaks when virtual is called and there's ob_ usage in the script called by virtual. I don't exactly care, as a user, where the problem is :) <5> so I accept what you say <7> i have a PHP script used to cache remote images to display on my site, any comments on how to make it more efficient would be appreciated : http://hashphp.org/pastebin?pid=6510 <5> in my case, the problem is solved not by removing virtual, but by removing ob_ usage in all but php scripts at the layer called directly by the user <1> earth: No, I'm not picking a fight, I'm saying it's incorrect to ***ert that there are any problems at all in ob_*(), because there aren't. There are problems in virtual(). And, as a user, you *should* care where the problem is, because ***erting it's in ob_*() eliminates a whole slate of PHP functions that aren't actually broken. <5> but, as you say, that is a very niche use related to legacy code <5> well, great. again, I accept that the real problem is in virtual. <5> you have convinced me. <5> and I agree that I should make the differentiation. <8> Hi! Could anyone point me in the right direction here please .. :) <1> earth: As for your DOM thing, it's not really a bug. <0> anyone here vbulletin savvy? just want to know if something is possible <8> say .. if I have a php script running .. it takes approx 15mins to complete .. what if I start the same script from crontab every one minutes.. how can I prevent the script from being run more than one time at the time.. ? :) <5> perhaps it is something I'm doing wrong. <1> earth: It is. Allow me to explain. <8> The obious way would be to write to a file .. like .. run.lock .. if that file exists, just exit.. <2> nobb: i use lock files <8> but i wanna know if there are any .. standard ways of synchronizing things :) <5> use mysql :] <8> dools: Cool. How do you use them?
<5> look at flock documentation <8> dodo, simpyl write to a file or use an API? <2> nobb: exactly as you describe <1> earth: Here's the thing: Anything after the close of the document element is considered noise. You're creating a new document, rooted at <event>. When you importNode() that document fragment, it's free to discard the trailing newline, because it's content that lives outside the document root. <5> but flock fails across many network file systems :\ <8> dools, great.. thanks for your input. I'll try that then and see how it works out.. :) <2> geez, a framework for a lock file haha <5> nobb: check flock documentation <1> Better would be to acquire a semaphore <5> I use mysql for all of my synchronizing, since I can use table and row locks. <1> That's what they're for <5> :) <1> nobb: Check out php.net/sem <8> earth, ah.. didn't realize that you were talking to me :) I will check that out, thanks <1> It's a better solution than flock <5> ok, TML, do you have a suggestion for how to retain the line returns after the nodes when importing XML <8> TML, and thanks to you too .. :) <1> earth: $mParentNode->appendChild($mainDocument->createTextNode("\n")); <1> earth: As the last thing in the loop. <5> ok, thanks. <1> You're appending a textnode that contains \n <5> oh, yeah, if you're able to stay all in PHP, shared memory can work. <1> Actually, the nice thing about a semaphore is that anything on the machine can see it <1> earth: But you're doing it in the mainDocument, so that it doesn't get "trimmed" <1> earth: Make sense? <5> yes, actually. <1> earth: the loadXML is one of those cases where it's actually *correct* to disregard the whitespace...because it's "outside" the document itself <5> that makes sense to me. <9> hi. question: why does var_dump('11111111111111111' == '11111111111111112'); return true? makes only sense if php does an implicit cast to int, but i dont see the reason... <5> ok, good. that solves the problem. I'm unclear whether that is preferred or the docfragment solution is preferred. <9> btw, var_dump('1111111111111111' == '1111111111111112'); returns false ?! <1> earth: I don't think it really makes a difference. <1> earth: Whichever looks better to you <5> thanks <5> Perhaps a comment in the documentation for loadXML that suggests that solution? <1> earth: Go ahead. I don't see it as actually being neccesary, because DOM shouldn't ever be used for pretty printing XML anyways, but I'm not opposed to seeing a note. <10> how do i translate string into UTF-8? <1> mrix: php.net/utf8_encode <1> Anyone else having issues with google? <5> not I. <11> hi, if i define an array like: $TmpError=array(array()); and add elements with: $TmpError[]=$content; I got an element 0 with no content, how can I avoid this? <1> Badcel: By not defining the array as array(array()) <12> idd <13> what is this sort of ***ignment called? : $array[] = $info; <12> try to print_r($TmpError) and see if u have the structure you wanted <1> Jmax: What do you mean? <1> !tell z1n about u <12> i am i so bad at that <12> sorry <1> z1n: Most clients can be configured to fix that for you <13> TML: the [] part <13> TML: what's that called and do you know of a reference for it? <12> cool <13> the empty bracket ***igning heh <1> Jmax: It's appending to an array, I'm not sure what you mean by "a reference for it" <12> [] is a place in the array <13> oh <13> ok <11> works TML :) <1> Actually, it's not a place in the array...not until you put something in there, anyways <12> [0] is place 0 ofcourse .. by doing [] you add to the array and make a new place <12> TML, :P <13> ahh ok <12> if you only have 1 place ([0]) [] would be place [1] <5> I think it' <5> doh. I think it's equivalent to http://us3.php.net/manual/en/function.array-push.php <1> earth: It is <5> or, in perl $array[$#array + 1] :) <13> :) <13> thanks <12> yay you now works :P <12> was reading the guidelines ... what is xyz ?
Return to
#php or Go to some related
logs:
installing mupen64 on ubuntu sil3112 debian mount wg111v2 ubuntu TuxNotes lvm2 preinstallation error rpm exlusive lock linux USE +fortran +gentoo nma_dbus_init acquire service
#web tcp_keepalive_time torrent
|
|