php-general Digest 26 Jul 2012 10:13:01 -0000 Issue 7898
php-general Digest 26 Jul 2012 10:13:01 - Issue 7898 Topics (messages 318555 through 318563): Re: What do you call the end-user? 318555 by: Shawn McKenzie 318556 by: Paul M Foster Re: E_STRICT safe PEAR 318557 by: Sebastian Krebs 318558 by: Lester Caine 318559 by: Sebastian Krebs 318560 by: Lester Caine 318561 by: Sebastian Krebs 318562 by: Lester Caine How to write and read serial or parallel port 318563 by: viper 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 -- ---BeginMessage--- On 07/19/2012 12:26 PM, Tedd Sperling wrote: Hi gang: I can't wait for tomorrow -- so here's my off-topic post today. First question: What do you call the people who ultimately use your code? Many times I would call them dumb asses. Especially many of the users of free software. Even with clear detailed user guides and the fact that it is free, they are indignant about a missing feature or having to look in the docs for anything. -- Thanks! -Shawn http://www.spidean.com ---End Message--- ---BeginMessage--- On Tue, Jul 24, 2012 at 10:12:34AM -0500, Shawn McKenzie wrote: On 07/19/2012 12:26 PM, Tedd Sperling wrote: Hi gang: I can't wait for tomorrow -- so here's my off-topic post today. First question: What do you call the people who ultimately use your code? Many times I would call them dumb asses. Especially many of the users of free software. Even with clear detailed user guides and the fact that it is free, they are indignant about a missing feature or having to look in the docs for anything. Very true. Also, apparently in some quarters, free == worthless. But in the case of FOSS, nothing could be further from the truth. Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com ---End Message--- ---BeginMessage--- Hi, I'm using Ubuntu, but here you can update the system packages with the pear executable too $ sudo pear update-channels sudo pear upgrade --alldeps Regards, Sebastian Am 24.07.2012 17:05, schrieb Lester Caine: Not sure the best place to ask this ... I've worked through all of my own codebase to eliminate E_STRICT warnings/errors and now I'm working on the more basic ones coming from PEAR such as PHP Strict Standards: Non-static method PEAR::isError() should not be called statically Since these are installed by the distribution, in my case SUSE12.1, is there a better version to download that is E_STRICT clean? Or o I h2ve to work through that as well for the modules that the third party libraries are picking up? ---End Message--- ---BeginMessage--- Sebastian Krebs wrote: Hi, I'm using Ubuntu, but here you can update the system packages with the pear executable too $ sudo pear update-channels sudo pear upgrade --alldeps The question is - Is the result E_STRICT safe? I've got what I think is the latest from SUSE12.1 but with PHP5.4 I have to disable E_STRICT again in order to use anything from it ... Regards, Sebastian Am 24.07.2012 17:05, schrieb Lester Caine: Not sure the best place to ask this ... I've worked through all of my own codebase to eliminate E_STRICT warnings/errors and now I'm working on the more basic ones coming from PEAR such as PHP Strict Standards: Non-static method PEAR::isError() should not be called statically Since these are installed by the distribution, in my case SUSE12.1, is there a better version to download that is E_STRICT clean? Or o I h2ve to work through that as well for the modules that the third party libraries are picking up? -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk ---End Message--- ---BeginMessage--- Am 24.07.2012 18:46, schrieb Lester Caine: Sebastian Krebs wrote: Hi, I'm using Ubuntu, but here you can update the system packages with the pear executable too $ sudo pear update-channels sudo pear upgrade --alldeps The question is - Is the result E_STRICT safe? Would say: Depends on the package you use. I don't use PEAR-packages myself, thus I don't really know. I would say: Try it out :) Test it on your dev-machine, or within a vm and nothing can break. I've got what I think is the latest from SUSE12.1 but with PHP5.4 I have to disable E_STRICT again in order to use anything from it ... Regards, Sebastian Am 24.07.2012 17:05, schrieb Lester Caine: Not sure the best place to ask this ... I've worked through all of my own codebase to eliminate
[PHP] How to write and read serial or parallel port
hi all! is it possible to write and read data on a COM or LPT port? is there any function or class in PHP? anyone has already done something similar? thanks, viper -- + http://vipertechnology.dyndns.org () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments + http://vipertechnology.dyndns.org/cotnact/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to write and read serial or parallel port
On 26/07/2012 11:12, viper wrote: hi all! is it possible to write and read data on a COM or LPT port? is there any function or class in PHP? anyone has already done something similar? thanks, viper Hi, There is a class here: php-serial http://code.google.com/p/php-serial/source/browse/trunk/ I will be trying this myself tonight as I need to hook up to an arduino and retrieve some sensor readings. Regards Ian -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to write and read serial or parallel port
viper wrote: is it possible to write and read data on a COM or LPT port? is there any function or class in PHP? anyone has already done something similar? Talking in and out of the serial port is not too difficult but is OS dependent, so what are you wanting to run on? Most of the time you are just copying files in and out, although one can use the control signals as simple I/O if you only need a couple of controls. Parallel port is a minefield on Windows as access is specifically blocked in XP onwards. You need a modified device driver to bypass the blocks windows puts in. I've not tried that with PHP as I'm normally accessing the parallel port direct from other windows programs. Linux is lot easier, and most of the examples you will find via google are geared towards that. It works like DOS used to :) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to write and read serial or parallel port
On Thu, Jul 26, 2012 at 6:24 AM, Lester Caine les...@lsces.co.uk wrote: viper wrote: is it possible to write and read data on a COM or LPT port? is there any function or class in PHP? anyone has already done something similar? Talking in and out of the serial port is not too difficult but is OS dependent, so what are you wanting to run on? Most of the time you are just copying files in and out, although one can use the control signals as simple I/O if you only need a couple of controls. Parallel port is a minefield on Windows as access is specifically blocked in XP onwards. You need a modified device driver to bypass the blocks windows puts in. I've not tried that with PHP as I'm normally accessing the parallel port direct from other windows programs. Linux is lot easier, and most of the examples you will find via google are geared towards that. It works like DOS used to :) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php So for serial for example, you can just open the port up and work with it like a socket; read/write binary data. As far as parallel port goes, trickier, you may need to call out to an external program, or write a module if you need direct interaction in php. Real question is why in the world would you want to use PHP for this to begin with. I mean sure you can write your own vfat implementation in PHP, etc, etc, but it doesn't mean that it's a good idea to do so. -- Alex -- The trouble with programmers is that you can never tell what a programmer is doing until it’s too late. ~Seymour Cray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to write and read serial or parallel port
You read and write to it like any other file. Calls on windows will be slightly different. $PRINTERPORT = fopen(/dev/lpt1, r+); $PRINTERPORT = fopen(lpt1, r+); Cheers, Curtis viper wrote: hi all! is it possible to write and read data on a COM or LPT port? is there any function or class in PHP? anyone has already done something similar? thanks, viper -- + http://vipertechnology.dyndns.org () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments + http://vipertechnology.dyndns.org/cotnact/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to write and read serial or parallel port
Lester Caine wrote: viper wrote: is it possible to write and read data on a COM or LPT port? is there any function or class in PHP? anyone has already done something similar? Talking in and out of the serial port is not too difficult but is OS dependent, so what are you wanting to run on? Most of the time you are just copying files in and out, although one can use the control signals as simple I/O if you only need a couple of controls. Parallel port is a minefield on Windows as access is specifically blocked in XP onwards. You need a modified device driver to bypass the blocks windows puts in. I've not tried that with PHP as I'm normally accessing the parallel port direct from other windows programs. Linux is lot easier, and most of the examples you will find via google are geared towards that. It works like DOS used to :) There is an example of a serial port on php.net in the fopen function documentation. --C
Re: [PHP] How to write and read serial or parallel port
many thanks! i'll try all your solutions to find the best one! On Thu, Jul 26, 2012 at 2:37 PM, Alex Nikitin niks...@gmail.com wrote: Real question is why in the world would you want to use PHP for this to begin with. I mean sure you can write your own vfat implementation in PHP, etc, etc, but it doesn't mean that it's a good idea to do so. i know i can write something in c or c++ then use shell_exec, but this's just an experiment to test PHP vs COM/LPT On Thu, Jul 26, 2012 at 1:24 PM, Lester Caine les...@lsces.co.uk wrote: Talking in and out of the serial port is not too difficult but is OS dependent, so what are you wanting to run on? i'll test both win and linux with a sort of xPlataform script :) regards, viper -- + http://vipertechnology.dyndns.org () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments + http://vipertechnology.dyndns.org/cotnact/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to write and read serial or parallel port
Alex Nikitin wrote: So for serial for example, you can just open the port up and work with it like a socket; read/write binary data. As far as parallel port goes, trickier, you may need to call out to an external program, or write a module if you need direct interaction in php. Real question is why in the world would you want to use PHP for this to begin with. I mean sure you can write your own vfat implementation in PHP, etc, etc, but it doesn't mean that it's a good idea to do so. Well I use the parallel port to switch over channels on the PA system and control other things such as camera selection. While the PHP web pages have access to do it, they send a message to an old windows application and that talks to the parallel port. It would be nice to eliminate the messaging on smaller setups, along with the windows box, but it's worked for 15+ years ... I did simply assume that the question was one of writing data in terms of switching pins on and off rather than streaming files over the link :) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php