php-general Digest 8 Jan 2011 17:07:12 -0000 Issue 7122
Topics (messages 310595 through 310605):
Re: Command line PHP
310595 by: Larry Garfield
310596 by: David Hutto
310602 by: TR Shaw
310603 by: David Hutto
310604 by: Lester Caine
310605 by: Daniel Brown
Re: PHP extension for equivalen of "getent"?
310597 by: David Robley
310598 by: Michelle Konzack
310599 by: David Robley
310601 by: Peter Lind
Re: Validate Domain Name by Regular Express
310600 by: WalkinRaven
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:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Friday, January 07, 2011 9:34:42 pm David Hutto wrote:
> Which yielded this as the first result:
>
>
> http://php.net/manual/en/features.commandline.php
As noted in my original email, I find the native SAPI clunky and difficult to
work with. Hence I was looking for something more usable and robust built on
top of it that I could leverage rather than rolling my own one-off. Of
course, I got lost somewhere in the language holy wars (dear god, people...)
so I'll probably just take the "roll my own" approach.
--Larry Garfield
--- End Message ---
--- Begin Message ---
I could go yoda, but suffice it to say, "From The Language Speaks The
Soul Of The Man's Design".
--- End Message ---
--- Begin Message ---
On Jan 7, 2011, at 8:50 PM, David Hutto wrote:
> On Fri, Jan 7, 2011 at 8:44 PM, TR Shaw <[email protected]> wrote:
>>
>> On Jan 7, 2011, at 8:36 PM, David Hutto wrote:
>>
>>> I'm with some of the others above on using Python. Writing a command
>>> line app is about as simple as:
>>>
>>> import subprocess
>>> word = 'hello'
>>> self.espeak = subprocess.Popen(['espeak', word], stdout =
>>> subprocess.PIPE).communicate()[0]
>>>
>>> I think of PHP as more browser, than desktop app/webapp.
>>
>>
>> And in php the above is just:
>>
>> echo "hello";
>>
>> Which is simpler? The answer is the one that you are most comfortable with.
>
> I expect this might have been meant to go to the list, but I'll reply
> directly back.
>
> With the espeak installed. This calls a command line from your python
> script, and speaks the word, not just display. I understand this might
> be direct with certain abilities to display and speak the info.
> In python2.x it would be
>
> print 'hello', or print "hello", notice no ';'.
>
> How would you call a command line(from terminal) script from within a
> php desktop app? That was what the above was meant to demonstrate in
> python, not print it out to page, or terminal. But I'm guessing it
> might not be that different.
Sorry, David I should not reply quickly when I have a cold but again its all
pretty similar. Here it is on unix/linux.
PHP:
$word = "hello";
exec("say \"$word\"");
Bash:
word="hello"
say "$word"
In all the languages its hust:
1) set a variable
2) call an external program with the variable as an argument
after that its all about language specific syntax.
Tom
--- End Message ---
--- Begin Message ---
Like i said, my introduction to php is browser,and desktop app is
python, but I will try php in the command line out.
1) set a variable
2) call an external program with the variable as an argument
this is something I recognize very well:)
--- End Message ---
--- Begin Message ---
David Hutto wrote:
I'm with some of the others above on using Python. Writing a command
line app is about as simple as:
snip
I think of PHP as more browser, than desktop app/webapp.
The point I was trying to make was one where there are two paths to doing the
same job ...
Example
Thumbnail generation ...
These are either generated as part of the upload page, or processed as a
background task. There is no sense at all in writing the same function in two
different languages. We need the PHP version for the on-line processing, so why
would you then NOT use it also from the command line for the background
processing as part of a cron job? Processing email traffic is another area where
the same code is used both on and off line so using the same language again
makes sense.
OK new code could be done in a new language, but where php is already supported
it just makes sense to retain it? Unless of cause php is just wraping some other
system that is actually doing the work, such as browsing an hg repository, when
things start getting even more unmanageable :(
--
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//
Firebird - http://www.firebirdsql.org/index.php
--- End Message ---
--- Begin Message ---
On Sat, Jan 8, 2011 at 07:25, TR Shaw <[email protected]> wrote:
>
> Sorry, David I should not reply quickly when I have a cold but again its all
> pretty similar. Here it is on unix/linux.
>
> PHP:
>
> $word = "hello";
> exec("say \"$word\"");
>
> Bash:
>
> word="hello"
> say "$word"
<?php txt2wav('Hello','hello.wav'); ?>
--
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/
--- End Message ---
--- Begin Message ---
Michelle Konzack wrote:
> Hello Tommy Pham,
>
> Am 2011-01-07 19:31:17, hacktest Du folgendes herunter:
>> There's the chm download for the times when you're unplugged :)
>
> I was never able to open ths chm files under Debian
>
> Thanks, Greetings and nice Day/Evening
> Michelle Konzack
>
You might find http://xchm.sourceforge.net/ useful :-)
Cheers
--
David Robley
Everyone has photographic memory...some don't have film!
Today is Pungenday, the 8th day of Chaos in the YOLD 3177.
--- End Message ---
--- Begin Message ---
Hello David Robley,
Am 2011-01-08 16:25:38, hacktest Du folgendes herunter:
> You might find http://xchm.sourceforge.net/ useful :-)
----[ 'apt-cache policy xchm' ]-----------------------------------------
xchm:
Installiert: 2:1.14-4
Kandidat: 2:1.14-4
Versions-Tabelle:
*** 2:1.14-4 0
900 ftp://ftp2.de.debian.org lenny/main Packages
100 /var/lib/dpkg/status
------------------------------------------------------------------------
and it crash all the time... :-(
Thanks, Greetings and nice Day/Evening
Michelle Konzack
--
##################### Debian GNU/Linux Consultant ######################
Development of Intranet and Embedded Systems with Debian GNU/Linux
itsyst...@tdnet France EURL itsyst...@tdnet UG (limited liability)
Owner Michelle Konzack Owner Michelle Konzack
Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France 77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix
<http://www.itsystems.tamay-dogan.net/> <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/> <http://www.can4linux.org/>
Jabber [email protected]
ICQ #328449886
Linux-User #280138 with the Linux Counter, http://counter.li.org/
signature.pgp
Description: Digital signature
--- End Message ---
--- Begin Message ---
Michelle Konzack wrote:
> Hello David Robley,
>
> Am 2011-01-08 16:25:38, hacktest Du folgendes herunter:
>> You might find http://xchm.sourceforge.net/ useful :-)
>
> ----[ 'apt-cache policy xchm' ]-----------------------------------------
> xchm:
> Installiert: 2:1.14-4
> Kandidat: 2:1.14-4
> Versions-Tabelle:
> *** 2:1.14-4 0
> 900 ftp://ftp2.de.debian.org lenny/main Packages
> 100 /var/lib/dpkg/status
> ------------------------------------------------------------------------
>
> and it crash all the time... :-(
>
> Thanks, Greetings and nice Day/Evening
> Michelle Konzack
>
It's not Friday, so I won't go Off Topic and suggest you try compiling from
source :-)
Cheers
--
David Robley
"Boy, these blintzes are good!" said Tom judiciously.
Today is Pungenday, the 8th day of Chaos in the YOLD 3177.
--- End Message ---
--- Begin Message ---
On Jan 8, 2011 9:53 AM, "David Robley" <[email protected]> wrote:
>
> Michelle Konzack wrote:
>
> > Hello David Robley,
> >
> > Am 2011-01-08 16:25:38, hacktest Du folgendes herunter:
> >> You might find http://xchm.sourceforge.net/ useful :-)
> >
> > ----[ 'apt-cache policy xchm' ]-----------------------------------------
> > xchm:
> > Installiert: 2:1.14-4
> > Kandidat: 2:1.14-4
> > Versions-Tabelle:
> > *** 2:1.14-4 0
> > 900 ftp://ftp2.de.debian.org lenny/main Packages
> > 100 /var/lib/dpkg/status
> > ------------------------------------------------------------------------
> >
> > and it crash all the time... :-(
> >
> > Thanks, Greetings and nice Day/Evening
> > Michelle Konzack
> >
>
> It's not Friday, so I won't go Off Topic and suggest you try compiling
from
> source :-)
>
>
While you're busy being not off topic, perhaps it might be an idea to also
not point to a proper place for questions about debian tools to read chm
files? I'm sure there are plenty of resources like irc channels or such.
Regards
Peter
--- End Message ---
--- Begin Message ---
PHP 5.3 PCRE
Regular Express to match domain names format according to RFC 1034 -
DOMAIN NAMES - CONCEPTS AND FACILITIES
/^
(
[a-z] |
[a-z] (?:[a-z]|[0-9]) |
[a-z] (?:[a-z]|[0-9]|\-){1,61} (?:[a-z]|[0-9]) ) # One
label
(?:\.(?1))*+ # More labels
\.? # Root domain name
$/iDx
This rule matches only <label> and <label>. but not <label>.<label>...
I don't know what wrong with it.
Thank you.
--- End Message ---