php-general Digest 6 Aug 2006 06:31:46 -0000 Issue 4277
php-general Digest 6 Aug 2006 06:31:46 - Issue 4277 Topics (messages 240188 through 240197): Re: Sending data to persistent process stdin 240188 by: Ville Mattila 240190 by: Stut Re: PHP Frameworks - Opinion 240189 by: Manuel Lemos 240193 by: Robert Cummings Re: The difference between ereg and preg? 240191 by: Dave M G 240194 by: Robert Cummings Using preg_match to find Japanese text 240192 by: Dave M G Re: PayPal's PHP SDK on Windows 240195 by: phpwizard02 #comment, (* comment *), -- Any good alternatives to !-- HTML comments? -- 240196 by: Micky Hulse 240197 by: Micky Hulse 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: php-general@lists.php.net -- ---BeginMessage--- Stut kirjoitti: 1) Find out how to create a named pipe and start mpg123 to take its input from that named pipe. Your PHP scripts can then write commands to that pipe. Thanks Stut, rather good idea... I tried following commands: mkfifo mpg mpg123 -R mpg And in another shell echo LOAD mp3file.mp3\n mpg Unfortunately, the mpg123 quits immediately without any response... In general, the idea sounds good, but there is still something uncompatible. Ville ---End Message--- ---BeginMessage--- Ville Mattila wrote: Stut kirjoitti: 1) Find out how to create a named pipe and start mpg123 to take its input from that named pipe. Your PHP scripts can then write commands to that pipe. Thanks Stut, rather good idea... I tried following commands: mkfifo mpg mpg123 -R mpg And in another shell echo LOAD mp3file.mp3\n mpg Unfortunately, the mpg123 quits immediately without any response... In general, the idea sounds good, but there is still something uncompatible. There's really no good reason that shouldn't have worked. I suggest you find an mpg123 mailing list and ask them why that happened. -Stut ---End Message--- ---BeginMessage--- Hello, on 08/04/2006 05:47 PM Robert Cummings said the following: The point of the post is that there is no framework in particular to recommend. I use my own packages for my needs. They suit me well. It does not mean they will suit everybody. How would you know that there is no framework to recommend if you neve ruse anyone's code but your own. How could you have possibly given any framework sufficient attention to have any idea of its pros and cons? I know many frameworks that exist, I have seen their code and their documentation, which is more than enough to reach the conclusion that using the frameworks that exist is not better that using my own solutions for my own purposes. Aaaah, so you are trully a genius to be able to at a glance of documentation and source code fully deduce the usefulness of something. I bow before you. Be seriuos. Nobody needs to actually use any framework to see that it is not suitable for your needs, when you can just browse the source code and documentation. It would be insane to try all PHP frameworks that exist to reach that conclusion. And there's the rub... your article was not about what YOU needed it was what YOU considered to be the best framework for everyone based on briefly browsing the code. Your article, if it had any real merit, would have reported on the actual trial of a substantial number of frameworks so that you could provide a valuable analysis instead of superficial opinion. Remember a recommendation, is not about YOU, it's about those reading the article. I can agree with your previous statement until you start recommending it in general. My article is mine. It was not written for you but rather to the PHPClasses site users in first place. Therefore it includes whatever I think it is best for me to mention. If you do not agree and think it should be something else, go and write your own article in your own blog rather than bossing me to do something different, as if I owe you anything. You can't have your cake and eat it too. You're either pro-choice with a myriad of choices to choose from, or you're anti-choice and want only one framework style. Get of the fence! Having standard API specifications does not prevent anybody to choose using solutions based on APIs that do not conform to any standard specifications. Furthermore I do not think that seem to understand the difference between an API specification and API implementation. J2EE is an API specification with many implementations from different vendors: Sun, IBM, Oracle, BEA, JBoss (this last one is Open Source). You can choose the implementation you want. There is plenty of choice to anybody. If you want to use a J2EE implementation to build your applications, otherwise you are free to use something else. It's seems people have chosen...
Re: [PHP] #comment, (* comment *), -- Any good alternatives to !-- HTML comments? --
Micky Hulse wrote: Any other alternatives? I would like to find a way of adding comments to an XHTML PHP page that is quick and easy. Ah, nevermind... I should have never posted this question. This solved my problem (IE duplicate char bug): !--[if !IE]Put your commentary in here...![endif]-- I was trying to think of ways to include comments in my html templates that did not involve actual html comments. Anyway, after posting, I realized that PHP would not really do the trick... More info here if anyone interested: http://www.positioniseverything.net/explorer/dup-characters.html Sorry for spamming list. I have not had much sleep lately. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending data to persistent process stdin
Ville Mattila wrote: Hello readers, I have been thinking of making a simple web-based interface to control my media center box (running debian linux). Being a bit enthustiatic, I thought I could use some generic tools for playing media files and write the whole UI by my own. I found mpg123 program that can be run in remote mode (mpg123 -R) so that playback can be controlled via stdin. Writing LOAD mp3 file to the stdin will begin output, PAUSE will stop it and so on. How could I use PHP and its process functions to send something to stdin of a persistent process? I would like to run mpg123 only once, whichafter a few PHP scripts would send data and proper commands to its stdin. Maybe a kind of daemon process would be needed? Anyway, sending data to a daemon can be problematic... Maybe a kind of socket wrapper? Well - I have no experience about socket functions of PHP... Tips and tricks are welcome, or should I just go to the local hi-tech market and by a CD player LOL :D I have done something similar using both mpg321 and madplay. However I used signals rather than holding open stdin. It's a little ugly but very simple, From memory: STOP pauses CONT resumes QUIT causes it to stop playing and terminates the process To play a new song, start a new process. USR1 does something, I think USR2 does something too. I just can't remember what. There should be documentation for mpg123 that explains all the signals and how it reacts. If not you could find it fairly easily by browsing the source. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The difference between ereg and preg? [SOLVED]
Robert, Thank you for pointing me to the relevant part of TFM that I needed to R. The final regular expression that I have settled on that is reliably producing expected results is: #li(.*)br#isU This finds all the text between a li and br tag. I found that it was helpful for me to restrict the the tags down to simple constructs, instead of having li[^]*, because in the source I'm using, the li and br tags never have additional parameters. Having a more flexible li definition was causing confusion with a link tag elsewhere in the source. Anyway, the point is that it works very well now. Thanks to the PHP list, especially Jochem, Ligaya, Dave, Robert, Mike, Robert, Adam, and John, for all your helpful information and advice. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] client-server upload communication?
Hi gang: I posted this question on a js list, but didn't received an answer. Maybe someone here might be able to provide some insight or direction. In my ajax experiment monitoring states, namely: http://xn--ovg.com/ajax_readystate I can see the readyState replies/conditions. Is there something similar when uploading a file or image? There has to be some sort of communication between the sender and the receiver, right? If so, is there a way to tap into that communication? Thanks in advance for any replies. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] client-server upload communication?
Your page currently has a JS error but... The short answer is not in PHP. The PHP script doesn't 'process' the upload of the file. When the file is received by the server, the script (line 1) starts executing AFTER the file is already fully uploaded, and the files temporary location is references in the $_FILES array. You may be able to get access the the state of the upload using a PECL extension, I remember reading something somewhere... My assumption here is you're trying to write a progress bar or something similar? If all you're after is a 'state' then you could submit your form to an embedded iframe and have the resulting page run an I'm done javascript, but that would only give you the start (when the user clicks submit) and the end (when the done function runs), it won't give you a true state during the course of the upload. - Jeff P.S. You could use perl as it has access to the file WHILE it's uploading, not just after, but that's for a different list :c) On 6-Aug-06, at 10:56 AM, tedd wrote: Hi gang: I posted this question on a js list, but didn't received an answer. Maybe someone here might be able to provide some insight or direction. In my ajax experiment monitoring states, namely: http://xn--ovg.com/ajax_readystate I can see the readyState replies/conditions. Is there something similar when uploading a file or image? There has to be some sort of communication between the sender and the receiver, right? If so, is there a way to tap into that communication? Thanks in advance for any replies. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] client-server upload communication?
At 1:18 PM -0400 8/6/06, Jeffrey Sambells wrote: My assumption here is you're trying to write a progress bar or something similar? Yep. If all you're after is a 'state' then you could submit your form to an embedded iframe and have the resulting page run an I'm done javascript, but that would only give you the start (when the user clicks submit) and the end (when the done function runs), it won't give you a true state during the course of the upload. I've done something similar, namely: http://xn--ovg.com/aa But, it's faux upload -- I might as well stick with: http://xn--ovg.com/a/wait.php I'll look into your PERL suggestion -- that sounds intriguing. Thanks Jeff. tedd off to find his old Perl books -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using preg_match to find Japanese text
Dear all and Dave, I want to divide the first line into three variables, $word, $reading, and $meaning. And I want to divide the second line into two variables, $word and $meaning. What you(Dave) want seems to have some resemblance to what I tackled in last month.I tried to sort out some japanese characters which can input to my server but cannot be displayed correctly in japanese-main-portable-phone-browsers through my poor program. The following contains UTF-8 encoded Japanese text. If you specify EUC-JP in [mbstring] of php.ini (this is usual way when using Japanese character in PHP), I propose first to change that into Shift-JIS to solve this problem. Probably, you specify UTF-8 in charaset in your .phps. I propose to change it into SHIFT-JIS. As far as I executed, it is difficult to extract the specific japanese word. I think that you should add the processing which replaces a Japanese word with the other language ( English ) once in your server. In my case,I first made the list of the words which aren't displayed correctly in main-japanese-portable-phone-browsers through my poor program.Then, I checked a non-displayed-word on the list and programed to sort out a non-displayed-word (,and replace a non-displayed-word to a image). What I wrote above is probably not the advice which you(Dave) demand. I do not see linkpages in your e-mail yet.I am sorry of my poor advice. Anway,I send this to you. Thank you for being interested in Japanese.Dave Thank you for developing [mbstring] in php.ini. developers. . Madoca signature.asc Description: このメッセー ジにはデジタ ル署名された 部分がありま す
Re: [PHP] Re: PHP Frameworks - Opinion
2006/8/4, Manuel Lemos [EMAIL PROTECTED]: Hello, on 08/03/2006 05:18 PM Martin Alterisio said the following: Anyway, you may want to read this more in depth reflection of the state of the PHP framework world and recommendations on how to pick what suits best for you: http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html Sorry to intrude with my usual obnoxious behaviour, but this is starting to affect my self-esteem (what's left of it). Am I the only one who has a really hard time reading the blog posts in phpclasses.org? Everytime a reference to this blog is posted I lose track of the discussion, because I can't really grasp what Lemos is talking about. I'd like to make some some constructive criticism, not just to Lemos but to the community in general, since I think many of us need to improve our writing skills: 1 - Don't make lng boooring posts. This blog in reality is the site monthly announcement newsletter. Some months there is more to tell than in others. I usually put a list of contents when the post is about many subjects. Then maybe you should consider making it a _weekly_ announcement newsletter, 'cause some of those posts are really really too long to digest in only one shot. 2 - Get to the point. Introduction are great when they are not two pages long. I don't know what you mean by introduction. Usually there is a summary that goes in the RSS feed that is no longer than 3 or 4 paragraphs. I mean all the things you need to say before actually getting into what you want to talk about. Just take for example the post about recommend php framework, look how much you have to read before actually get any info relating directly to php frameworks. Is true that there are many things to say before about frameworks hype, but couldn't it be explained in less words? 3 - Stick to the topic. Or use appropiate titles. 4 - If the topic is inherently long, use distinguishable headers and subheaders. It's a pain in the ass to read a 5 pages long article that looks the same everywhere, with no easy way to know what is the subtopic of what are you reading now. As I said, these posts often cover many topics. It may not seem by topic sections use titles. The problem is that this newsletter posts used to go by e-mail to the site subscribers in plain text, so there was no way to format titles. I was unaware of that, I understand now. It's really a pain in the ass to format a text only email for proper reading even more if the same text has to be used in a website. Anyway, now that you mentioned it I applied an additional regular expression to add title formatting when presenting it in the site. Just let me know if it looks ok now. Yeah, I saw that. I believe it's a little bit better now. 5 - Don't talk so much about your life! You can always make another blog for that... Unless your personal experience can bring an unique insight of the point you're trying to make. I suppose you may be talking about other peoples blogs. Personal blogs are supposed to be personal. This is the PHPClasses site blog. Usually it covers matters about the site developments and matters of interest to the site users. It does not talk about my life. It may talk about my experience when it is relevant to the post topic. Generally speaking, yes, I'm talking about other peoples blogs. I'm sick tired of all the holy crusades out there, specially when it comes to Web2.0evangelists. You may have not noticed it but somewhere here or there you let your subconcious write for you, specially on the topic of Web2.0 (I used the term twice already, please stop me before I have to pay royalties to O'reilly). It may be just an adjective, but that's all it takes to make a mildly objetive point of view turn into a completely subjective point of view. Just check your article about is php ready for ... *that thing I said before*, and you'll see that how, without noticing it, personal feelings tend to appear and change the article completely. Probably that's what made you write so much about how you believe phpclasses.org is a *that term* enabled site, and why. Was all that really necesary for the purpose of the article? Or you were just uncounciously trying to prove something to all those lamers out there? Does it really matter if your site is in or out? We are not fashion designers...
Re: [PHP] OT promotion candidates needed
Jay Blanchard wrote: Good news/kinda' bad news (but not really); I am proud to say that I have been promoted to Director of IT in my little corner of the world. Congrats on the promotion - Love the pretty title. Does it come with letters even? ;) -- life is a game... so have fun. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT promotion candidates needed
Director, nah. Wait until you are promoted to Dictator of IT. That's where the real power begins. BWAHAHAHAHAH...cough. Enough maniacal laughing for now, back to work. -Original Message- From: Ligaya Turmelle [mailto:[EMAIL PROTECTED] Sent: Sunday, August 06, 2006 7:16 PM To: Jay Blanchard Cc: [php] PHP General List Subject: Re: [PHP] OT promotion candidates needed Jay Blanchard wrote: Good news/kinda' bad news (but not really); I am proud to say that I have been promoted to Director of IT in my little corner of the world. Congrats on the promotion - Love the pretty title. Does it come with letters even? ;) -- life is a game... so have fun. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php