| |
| |
| |
|
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
Comments:
<0> it's a moot point though, since any implementation of them is going to be a hackish mess. <1> hey guys, i seem to remember from a long time ago there was a single function that would get php to run a linux command and print the result to a webpage as if you'd typed it into the terminal manually but i cant remember its name, can anyone help? <0> in php anyway <2> Because the language itself contains no support for them <2> Which is why I said what I said. <1> its ruby equivilent would be IO.popen <3> Right, which is what I was lamenting. <2> If this had been #haskell or something, I would have been more careful. <2> Olek: php.net/exec <0> Olek: popen() exists in php as well. <2> Pollita: You been through the new "Advanced Unix Programming" from AWP? <4> is there a php function to convert unix newlines to windows newlines? <0> jcoby: str_replace() <2> jcoby: str_replace() <4> heh <2> <:O
<1> thanks guys :) <2> I have been "teh defeated"! <4> ok, what if you don't know what format it's in? str_replace would double up on the newlines if it is already in windows format? <5> s/e/3/ <2> Jymmm: Thanks <2> jcoby: No, it'd do something very odd <4> TML: right.. that's what i'm trying to avoid :) <2> jcoby: \r\n would become: \r\r\n <6> Does anyone know how to override a cl*** method without extending the cl***? Kinda like function_override(). I'm trying to extend a CMS and I'm trying as hard as I can to avoid editing the "Core" code. <2> Anyone else notice lots of lag of late? <7> how can I got to the next element in a foreach loop? like -> foreach($array as $value) if ($value == 'foo') skip to next element; <7> s/got/go <8> spuds, continue; <2> EmprCezar: You can't without doing something really evil such as runkit. <6> What's runkit? <9> Anyone know if MDB2 supports pdo? <10> i want to create a function inside a cl***, and the function takes 2 arguments that reference variables, like this: $this->_myFxn(&$csvLine, &$this->bigArray); ...the function will extract data from the CSV string $csvLine into a temporary array, and then push that temporary array to $this->bigArray <10> how would i define the function and how would i call it? i'm not too familiar with using the & symbol <6> TML I see, it's a php extension <7> mfonda, thanks! <2> EmprCezar: An evil, evil creation that allows you to violate PHP like you're its 300 lb. prison cellmate. <2> joe333: You don't need a & on either of those. <8> Solara, there is no PDO driver for mdb2 <10> TML, but i don't want to p*** the values of either variable... i just want to reference them <10> basically i just want to shorten 10 lines of code to 1 fxn call <2> joe333: You misunderstand what & does. <11> how can I run function named function_($i).. if $i is orange, run function_orange, if $i is green, run function_green <10> i guess so... i thought it works the same way as c++ ...of course it's been years since i took a c++ cl*** <2> myconid: How did you get yourself in THAT mess? <12> ${funcname}() <2> joe333: It absolutely is NOT even *close* to C++ <10> TML, so how do you distinguish between p***ing a variable and p***ing a reference to a variable in php? <9> mfonda: Well MDB2 said it would support pdo before stable and its listed as stable now -.- <11> TML: I want a function to edit images.. so i need to open it,and save it.. <2> joe333: You can't p*** a reference to a variable in the way you're thinking. <2> joe333: PHP doesn't have that kind of references <4> myconid: "function_{$i}"($i) <6> myconid: You can also use call_user_func('function_'.$i) <2> myconid: Go on... <4> myconid: you can also stick the function name in a var and call it via $funcname($i) <8> Solara, do you see a PDO driver on pear.php.net or in CVS? <6> myconid: I think there are about a thousand ways to do it <8> Solara, I dont <10> TML, so if i try to shorten these 10 lines of code (repeated at least a dozen times in different parts of my cl***) into 1 fxn is it going to degrade performance due to all the added variable copies? <2> dj_segfault: ${funcname}() doesn't work. <2> dj_segfault: Just as an FYI <9> mfonda: I was going for the wishful thinking approach <13> in apache log --[client 129.21.61.206] PHP Fatal error: Call to undefined function curl_init() <2> joe333: It's unlikely that PHP's copy-on-write copying of variables is going to create a significant performance decrease. <2> pc2: You don't have curl <13> the line is <13> $ch = curl_init(); <2> pc2: You don't have curl <13> curl --version <13> curl 7.12.0 (i686-suse-linux) libcurl/7.12.0 OpenSSL/0.9.7d ipv6 zlib/1.2.1 <2> pc2: See how it says "Call to undefined function curl_init()"? <8> myconid, $function = 'function_' . $i; $function(); <2> pc2: Your PHP doesn't have the curl extension. <13> TML - How can I check/test/fix that? I installed libcurl <2> pc2: libcurl isn't a PHP extension <2> pc2: It's a C library
<13> i php4-curl .3.8 .3.8 PHP4 Extension Module 35.2 kB <2> joe333: $this->bigArray[] = $this->_myFxn(&$csvLine); // Shouldn't have any effect whatsoever. <13> That's from my distribution anyways. <2> pc2: If you have php4-curl, then you need to make your PHP aware of it. Are you using the apache module? <10> TML, well then i might have a different problem... i want to reference one of the cl***'s arrays inside this fxn... if i understand you correctly, then p***ing $this->bigArray as a fxn argument and adding to that array inside the fxn will only update the array within the scope of the fxn, and it won't update the cl***'s array $this->bigArray ....or am i way off? <10> TML, nevermind... <13> TML - can I tell in htptd.conf? <2> joe333: $this->foo changes the object-wide instance of foo <2> joe333: So if you want to modify $this->foo inside a cl*** method, you don't need to p*** it as an argument. Just call it from within the method. <10> i can just leave out the line: array_push($this->bigArray, $tmpArray); in the fxn and instead have the fxn return $tmpArray <2> pc2: No <2> joe333: That would be my suggestion. <2> Oh, wait, it already was. :) <2> pc2: Do you know where your php.ini is? <10> TML, i understand that... my original idea was to make this function work for a few different cl*** arrays, so i wouldn't have to create multiple fxns like _addToBigArray() and _addToLargeArray() and _addToGiantArray() <10> but i think i know how to work around it now <2> joe333: <:I <10> thx for the help <13> TML - yes <2> That's some variable naming scheme you've got there. <10> just an example ;) <2> pc2: Are you using the apache module? <10> TML, actually, that brings up another question... is there a limit to the number of arrays i can nest? <2> No <2> But if you find yourself going more than 3, I submit that your code needs to be refactored <2> Deeply nested data structures are hard for humans to get right. <10> yeah well luckily i'm the only one who needs to get it <2> ... <10> and once it works i'll just forget it all <10> j/k <10> the real hard part will be when i try to convert this cl*** to Ruby or Python... still haven't decided whether i'm going to move to Ruby on Rails or Django <13> TML - http://cainkar.com/tmp/php.ini <2> pc2: Please, for the love of all things sacred, answer the damn question! Are. You. Using. The. Apache. Module? <13> TML - I don't know what that is :( <2> pc2: Who installed PHP on your machine? <14> Hi all <13> TML - distribution -- stock <2> pc2: *Who*? <2> Not "from where". <2> WHO <13> TML - suse <13> TML - me <2> pc2: I can tell you with 100% ***urance that PHP doesn't come installed "stock" on SuSE. You installed PHP from YaST? <2> Is there a reason it takes you 5 minutes to answer every question? <13> TML - yes -- 20 people keep walking into my office. I apologize. <13> TML - yes, I used yast. <13> TML - You have my attention now :) <2> pc2: What was the name of the package in yast that you installed to get PHP on your machine? <13> rpm -qa | grep php <13> php4-4.3.8-8.14 <13> php4-curl-4.3.8-8.2 <13> php4-mysql-4.3.8-8.2 <13> Let me load yast and look. <2> pc2: BTW, that URL you gave is a 404 <13> TML - try http://cainkar.com/temp/php.ini <13> php4 .3.8 .3.8 PHP4 Core Files 2.9 MB <13> i php4-curl .3.8 .3.8 PHP4 Extension Module 35.2 kB <13> that is from yast <2> pc2: Please don't paste all of that here. <13> Sorry. <2> So you installed php4, but not anything like mod_php4 or libapache-mod-php? <13> TML - correct <13> TML - just checked in yast <2> pc2: Are you accessing your PHP scripts via the web, or are you using PHP as a command-line language? <13> TML - I have used many php programs before without issue (gallery2, etc.). <13> web. <2> pc2: And you are the sole admin of this machine? <13> yes <2> pc2: What does <?php php_sapi_name(); ?> say? <15> hi there, does anyone knows how I can run some script in the background? (i've to perform some action which take around the 30-60 sec., and I don't want the user to wait for that)
Return to
#php or Go to some related
logs:
#css #css #bash grub4win
#ubuntu hoe to run xorg.conf rapidsvn plink /sbin/bash bad interpreter libavastengine rpm Gnome keyboard preferences not working
|
|