FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » anyone else writing Linux (or cross-system) applications in PHP?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
anyone else writing Linux (or cross-system) applications in PHP? [message #180246] Sat, 02 February 2013 20:27 Go to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
(Apologies for the cross-post.)

I don't like bash, haven't seen anything that crude since back in the
days when I was writing FORTRAN and BASIC, so I've been writing all of
my local applications in PHP.

The folks who frequent comp.lang.php seem to be pretty web-centric which
makes sense as far as that goes. The folks who frequent the various
Linux fora seem pretty bash-centric which also makes sense as far as
that goes.

As an aside, I've been using Linux for long enough now to realize how
shell-centric it is as an operating system; I'm somewhat blown away by
that but it too makes its own kind of sense.

Is there a forum where the other folks (presuming there are any) who
have been writing applications in PHP hang out? Don't say "yeah dummy,
go to comp.lang.python" please, my homor quotient is maxed out for
today. <g>
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180247 is a reply to message #180246] Sat, 02 February 2013 20:57 Go to previous messageGo to next message
DanS is currently offline  DanS
Messages: 4
Registered: February 2013
Karma: 0
Junior Member
On Sat, 02 Feb 2013 13:27:45 -0700, crankypuss wrote:

> (Apologies for the cross-post.)
>
> I don't like bash, haven't seen anything that crude since back in the
> days when I was writing FORTRAN and BASIC, so I've been writing all of
> my local applications in PHP.
>
> The folks who frequent comp.lang.php seem to be pretty web-centric which
> makes sense as far as that goes. The folks who frequent the various
> Linux fora seem pretty bash-centric which also makes sense as far as
> that goes.
>
> As an aside, I've been using Linux for long enough now to realize how
> shell-centric it is as an operating system; I'm somewhat blown away by
> that but it too makes its own kind of sense.
>
> Is there a forum where the other folks (presuming there are any) who
> have been writing applications in PHP hang out? Don't say "yeah dummy,
> go to comp.lang.python" please, my homor quotient is maxed out for
> today. <g>

Are you talking desktop applications?

And what kind of applications?


http://stackoverflow.com/questions/40870/why-dont-people-use-php-for-
desktop-applications

http://www.wisecodes.com/2009/03/create-php-desktop-applications-
calculator/

http://www.developertutorials.com/tutorials/php/building-desktop-
applications-in-php-8-02-01-934/

See what people are contributing for PHP at PlanetSourceCode.com:

http://www.planetsourcecode.com/vb/default.asp?lngWId=8
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180248 is a reply to message #180246] Sat, 02 February 2013 21:27 Go to previous messageGo to next message
Jonathan N. Little is currently offline  Jonathan N. Little
Messages: 12
Registered: February 2011
Karma: 0
Junior Member
crankypuss wrote:
> (Apologies for the cross-post.)
>
> I don't like bash, haven't seen anything that crude since back in the
> days when I was writing FORTRAN and BASIC, so I've been writing all of
> my local applications in PHP.
>
> The folks who frequent comp.lang.php seem to be pretty web-centric which
> makes sense as far as that goes. The folks who frequent the various
> Linux fora seem pretty bash-centric which also makes sense as far as
> that goes.

Because for the web is where PHP originated. Get data, do something,
done. Not really suited for event driven apps. Late comer to acquiring
programming features like OOP. But it is evolving and things may change.

>
> As an aside, I've been using Linux for long enough now to realize how
> shell-centric it is as an operating system; I'm somewhat blown away by
> that but it too makes its own kind of sense.

I found bash so useful and powerful and confusing a bit at times. Beats
the stuffing out of MS batch files and easier than powershell for me.

>
> Is there a forum where the other folks (presuming there are any) who
> have been writing applications in PHP hang out? Don't say "yeah dummy,
> go to comp.lang.python" please, my homor quotient is maxed out for
> today. <g>

Because the python, perl, bash, c, and c++ is what is generally used.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180249 is a reply to message #180246] Sat, 02 February 2013 21:43 Go to previous messageGo to next message
Robert Heller is currently offline  Robert Heller
Messages: 60
Registered: December 2010
Karma: 0
Member
At Sat, 02 Feb 2013 13:27:45 -0700 crankypuss <noemail(at)noemail(dot)invalid> wrote:

>
> (Apologies for the cross-post.)
>
> I don't like bash, haven't seen anything that crude since back in the
> days when I was writing FORTRAN and BASIC, so I've been writing all of
> my local applications in PHP.

Bash is 'Born Again Shell' and is just an extended flavor of the Bourne
Shell, which is truly very simple in many ways. I don't think anyone
really considers bash seriously as something to write actual full-blown
applications in -- it never was (and is not) considered an 'application
programming language'. It is more meant either for basic simple
scripts -- short hand for commonly / repeatedly used command sequences
or for writing wrappers around applications that need some special
environment (like mozilla firefox). Tradionally, UNIX people write
their applications in C. These days, C++ has replaced C for larger
applications in many ways. Otherwise people use other high-level
languages, mostly scripting ones: Perl, Python (yech), Tcl(/Tk), Java,
XUL/JavaScript, etc. (And yes, for major number crunching
applications, FORTRAN is used heavily as COBOL is used heavily in
business applications.)

>
> The folks who frequent comp.lang.php seem to be pretty web-centric which
> makes sense as far as that goes. The folks who frequent the various
> Linux fora seem pretty bash-centric which also makes sense as far as
> that goes.
>
> As an aside, I've been using Linux for long enough now to realize how
> shell-centric it is as an operating system; I'm somewhat blown away by
> that but it too makes its own kind of sense.

The shell is what makes the world go round... :-) The shell is like
connective tissue. Not terribly exicting or useful on its own, but
without it, everything would fall apart.

>
> Is there a forum where the other folks (presuming there are any) who
> have been writing applications in PHP hang out? Don't say "yeah dummy,
> go to comp.lang.python" please, my homor quotient is maxed out for
> today. <g>

Yeah, I don't like Python either. Many people use Perl, but I consider
Perl something of a write-only language (Perl is the new APL). *I* use
Tcl(/Tk) for desktop applications, both for non-GUI scripting and for
GUI applications (even rather major ones). PHP is not really intended
for standalone *desktop* applications. It was *specificly* designed
for Web Applications and has many *core* features specific for such
applications. I don't believe there are any GUI toolkits available for
php.

>

--
Robert Heller -- 978-544-6933 / heller(at)deepsoft(dot)com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180250 is a reply to message #180246] Sat, 02 February 2013 22:20 Go to previous messageGo to next message
Keith D. Lee is currently offline  Keith D. Lee
Messages: 1
Registered: February 2013
Karma: 0
Junior Member
All:
What about Perl?
--
Sincerely,
Keith D. Lee
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180251 is a reply to message #180246] Sun, 03 February 2013 09:58 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 02.02.2013 21:27, schrieb crankypuss:
> (Apologies for the cross-post.)
>
> I don't like bash, haven't seen anything that crude since back in the days when I was
> writing FORTRAN and BASIC, so I've been writing all of my local applications in PHP.
>
> The folks who frequent comp.lang.php seem to be pretty web-centric which makes sense
> as far as that goes. The folks who frequent the various Linux fora seem pretty
> bash-centric which also makes sense as far as that goes.
>
> As an aside, I've been using Linux for long enough now to realize how shell-centric
> it is as an operating system; I'm somewhat blown away by that but it too makes its
> own kind of sense.
>
> Is there a forum where the other folks (presuming there are any) who have been
> writing applications in PHP hang out? Don't say "yeah dummy, go to comp.lang.python"
> please, my homor quotient is maxed out for today. <g>

The way it is now is the result of usage patterns and hype.

Just from memory, and I'm talking about usage, not existence:

First was the original (Bourne) shell, then came the Korn shell with some
improvements you see now in the "Bourne again" shell. Then there was the perl hype.
Then there was a short hype about Tcl, when after installation you had to build your
kernel, and could do "make xconfig" (Tcl/Tk script). Only then came PHP as "private
home page generator" or so. No wonder PHP is not used much on the command line.
Python was last to come.

Yes I think PHP Cli has got all it takes for programming, even signal handling. But
in system administration the bash is the shell that starts Linux up. And for
applications don't forget C, C++, Java, Pascal, and many many many ...

/Str.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180252 is a reply to message #180247] Sun, 03 February 2013 10:45 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 02/02/2013 01:57 PM, DanS wrote:
> On Sat, 02 Feb 2013 13:27:45 -0700, crankypuss wrote:
>
>> (Apologies for the cross-post.)
>>
>> I don't like bash, haven't seen anything that crude since back in the
>> days when I was writing FORTRAN and BASIC, so I've been writing all of
>> my local applications in PHP.
>>
>> The folks who frequent comp.lang.php seem to be pretty web-centric which
>> makes sense as far as that goes. The folks who frequent the various
>> Linux fora seem pretty bash-centric which also makes sense as far as
>> that goes.
>>
>> As an aside, I've been using Linux for long enough now to realize how
>> shell-centric it is as an operating system; I'm somewhat blown away by
>> that but it too makes its own kind of sense.
>>
>> Is there a forum where the other folks (presuming there are any) who
>> have been writing applications in PHP hang out? Don't say "yeah dummy,
>> go to comp.lang.python" please, my homor quotient is maxed out for
>> today. <g>
>
> Are you talking desktop applications?

Mostly.

> And what kind of applications?

Whatever.

>
> http://stackoverflow.com/questions/40870/why-dont-people-use-php-for-
> desktop-applications
>
> http://www.wisecodes.com/2009/03/create-php-desktop-applications-
> calculator/
>
> http://www.developertutorials.com/tutorials/php/building-desktop-
> applications-in-php-8-02-01-934/
>
> See what people are contributing for PHP at PlanetSourceCode.com:
>
> http://www.planetsourcecode.com/vb/default.asp?lngWId=8
>

The last thing I want is more shitsucking web forums, but thanks anyway.

Discussion does not happen in web forums, the clumsiness of the
mechanism prohibits it.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180253 is a reply to message #180248] Sun, 03 February 2013 10:49 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 02/02/2013 02:27 PM, Jonathan N. Little wrote:
> crankypuss wrote:
>> (Apologies for the cross-post.)
>>
>> I don't like bash, haven't seen anything that crude since back in the
>> days when I was writing FORTRAN and BASIC, so I've been writing all of
>> my local applications in PHP.
>>
>> The folks who frequent comp.lang.php seem to be pretty web-centric which
>> makes sense as far as that goes. The folks who frequent the various
>> Linux fora seem pretty bash-centric which also makes sense as far as
>> that goes.
>
> Because for the web is where PHP originated. Get data, do something,
> done. Not really suited for event driven apps.

I have code that says you're mistaken.

> Late comer to acquiring
> programming features like OOP. But it is evolving and things may change.

OOP is the worst thing that happened to PHP since mySQL.

>>
>> As an aside, I've been using Linux for long enough now to realize how
>> shell-centric it is as an operating system; I'm somewhat blown away by
>> that but it too makes its own kind of sense.
>
> I found bash so useful and powerful and confusing a bit at times. Beats
> the stuffing out of MS batch files and easier than powershell for me.

MS batch files, lol. Not familiar with powershell.

>>
>> Is there a forum where the other folks (presuming there are any) who
>> have been writing applications in PHP hang out? Don't say "yeah dummy,
>> go to comp.lang.python" please, my homor quotient is maxed out for
>> today. <g>
>
> Because the python, perl, bash, c, and c++ is what is generally used.

So it goes, eh? Everybody does what everybody has always done.

Well thanks, JNL. 'Preciate your reply.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180254 is a reply to message #180249] Sun, 03 February 2013 10:57 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 02/02/2013 02:43 PM, Robert Heller wrote:
> At Sat, 02 Feb 2013 13:27:45 -0700 crankypuss <noemail(at)noemail(dot)invalid> wrote:
>
>>
>> (Apologies for the cross-post.)
>>
>> I don't like bash, haven't seen anything that crude since back in the
>> days when I was writing FORTRAN and BASIC, so I've been writing all of
>> my local applications in PHP.
>
> Bash is 'Born Again Shell' and is just an extended flavor of the Bourne
> Shell, which is truly very simple in many ways. I don't think anyone
> really considers bash seriously as something to write actual full-blown
> applications in -- it never was (and is not) considered an 'application
> programming language'. It is more meant either for basic simple
> scripts -- short hand for commonly / repeatedly used command sequences
> or for writing wrappers around applications that need some special
> environment (like mozilla firefox).

From what I've seen, bash is commonly used for "applications" and in
the process it's commonly pushed way beyond its limits by what appears
to be the standard practice of not checking for errors. Probably my
glasses have lint stuck to them or something. <g>

> Tradionally, UNIX people write
> their applications in C. These days, C++ has replaced C for larger
> applications in many ways. Otherwise people use other high-level
> languages, mostly scripting ones: Perl, Python (yech), Tcl(/Tk), Java,
> XUL/JavaScript, etc. (And yes, for major number crunching
> applications, FORTRAN is used heavily as COBOL is used heavily in
> business applications.)
>
>>
>> The folks who frequent comp.lang.php seem to be pretty web-centric which
>> makes sense as far as that goes. The folks who frequent the various
>> Linux fora seem pretty bash-centric which also makes sense as far as
>> that goes.
>>
>> As an aside, I've been using Linux for long enough now to realize how
>> shell-centric it is as an operating system; I'm somewhat blown away by
>> that but it too makes its own kind of sense.
>
> The shell is what makes the world go round... :-) The shell is like
> connective tissue. Not terribly exicting or useful on its own, but
> without it, everything would fall apart.

I doubt that "everything would fall apart" but it might get a bit wobbly
until someone came up with some actual reliable bits to replace it.

>>
>> Is there a forum where the other folks (presuming there are any) who
>> have been writing applications in PHP hang out? Don't say "yeah dummy,
>> go to comp.lang.python" please, my homor quotient is maxed out for
>> today. <g>
>
> Yeah, I don't like Python either. Many people use Perl, but I consider
> Perl something of a write-only language (Perl is the new APL). *I* use
> Tcl(/Tk) for desktop applications, both for non-GUI scripting and for
> GUI applications (even rather major ones). PHP is not really intended
> for standalone *desktop* applications. It was *specificly* designed
> for Web Applications and has many *core* features specific for such
> applications. I don't believe there are any GUI toolkits available for
> php.

Yeah, there is plenty (meaning, "nearly enough") available in the way of
builtin functions, but PHP is web-oriented at least insofar as "echo"
and headers go.

What I'm using for desktop applications is something I'm building that
is (at present, anyway) based on ncurses. Except for the bits that need
to work with existing code, bits like nautilus scripts, and for that
kind of thing I'm using zenity which rather sucks but it only needs to
do a few simple things.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180255 is a reply to message #180253] Sun, 03 February 2013 11:00 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 03/02/13 10:49, crankypuss wrote:
>
>
> So it goes, eh? Everybody does what everybody has always done.
>

when there really is no better reason to select, that becomes dominant
as a choice influencing factor.

people are there who know the language, books, support tutorials,
compilers (where appropriate), libraries..

In the real world these are far more relevant than it it supports some
academically interesting construction or not.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180256 is a reply to message #180250] Sun, 03 February 2013 11:13 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 02/02/2013 03:20 PM, Keith D. Lee wrote:
> All:
> What about Perl?
>

Enjoy. No reason not to go back to the predecessor of PHP. That's
where PHP came from, y'know. Some fellow whose name I don't recall
built it to do the things Perl wasn't set up for. google "PHP history"
there's a bit in wikipedia about it.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180257 is a reply to message #180251] Sun, 03 February 2013 11:20 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 02/03/2013 02:58 AM, M. Strobel wrote:
> Am 02.02.2013 21:27, schrieb crankypuss:
>> (Apologies for the cross-post.)
>>
>> I don't like bash, haven't seen anything that crude since back in the days when I was
>> writing FORTRAN and BASIC, so I've been writing all of my local applications in PHP.
>>
>> The folks who frequent comp.lang.php seem to be pretty web-centric which makes sense
>> as far as that goes. The folks who frequent the various Linux fora seem pretty
>> bash-centric which also makes sense as far as that goes.
>>
>> As an aside, I've been using Linux for long enough now to realize how shell-centric
>> it is as an operating system; I'm somewhat blown away by that but it too makes its
>> own kind of sense.
>>
>> Is there a forum where the other folks (presuming there are any) who have been
>> writing applications in PHP hang out? Don't say "yeah dummy, go to comp.lang.python"
>> please, my homor quotient is maxed out for today. <g>
>
> The way it is now is the result of usage patterns and hype.
>
> Just from memory, and I'm talking about usage, not existence:
>
> First was the original (Bourne) shell, then came the Korn shell with some
> improvements you see now in the "Bourne again" shell. Then there was the perl hype.
> Then there was a short hype about Tcl, when after installation you had to build your
> kernel, and could do "make xconfig" (Tcl/Tk script). Only then came PHP as "private
> home page generator" or so. No wonder PHP is not used much on the command line.
> Python was last to come.
>
> Yes I think PHP Cli has got all it takes for programming, even signal handling. But
> in system administration the bash is the shell that starts Linux up. And for
> applications don't forget C, C++, Java, Pascal, and many many many ...
>
> /Str.
>

The big question in my sick mind is whether to build a distro that uses
PHP as its primary scripting language or build a new language that's
what PHP could have been if it hadn't been mucked-about by all and
sundry who gave it functions like is_array() and isset() and when a
language doesn't even have consistent naming conventions well there ya
go. <g>

Then they stuck on some OOP functionality and OOP is what everybody
thinks is the hot item but it's clumsier than hell to have to pass
around a this-pointer and you can't slip another layer into an existing
class derivation without rewriting half the world.

Of course at the same time there's the struggle over screen i/o,
everybody and his brother wants GUI which is fine except that character
mode has its uses as well. The obvious compromise is an embedded app
that uses PHP to write pages to an internal browser rendering engine but
html has its limitations and damned if I'm wanting to get involved in
javascript.

Meanwhile back at the ranch I'm building applications based on a
character-mode abstraction that runs on top of ncurses and just
basically working my way out in both directions from there.

Everybody needs a hobby, right? <g>
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180258 is a reply to message #180257] Sun, 03 February 2013 11:44 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
On 03/02/13 12:20, crankypuss wrote:

> The big question in my sick mind is whether to build a distro that uses
> PHP as its primary scripting language or build a new language that's
> what PHP could have been if it hadn't been mucked-about by all and
> sundry who gave it functions like is_array() and isset() and when a
> language doesn't even have consistent naming conventions well there ya
> go. <g>

There are loads of scripting languages, but you will always know that a
Linux (including Unix too) will have a shell installed, which makes the
shell scripting a lot more popular for you don't have to install another
dependency to be able to run. If REXX been built in by default in the
Linux/Unix world, then it would have been as popular for scripting as
Arexx in the Amiga community and replacing shell scripting with
something else will be something just for your own distro.

One thing talking against PHP is the memory leaking that happens over
time, writing a daemon you will have it to eat up memory and need to be
restarted and it don't help to use unset() every time you are finished
with a variable.


> Then they stuck on some OOP functionality and OOP is what everybody
> thinks is the hot item but it's clumsier than hell to have to pass
> around a this-pointer and you can't slip another layer into an existing
> class derivation without rewriting half the world.

Nothing forces you to use OOP, OOP has it's beauties, but not always the
optimal way to write the code.


> Of course at the same time there's the struggle over screen i/o,
> everybody and his brother wants GUI which is fine except that character
> mode has its uses as well.

Sure you can write desktop applications in PHP, but not all OS:es has
gtk/qt/ncurses bindings and not all Linux distributions has those
available from the official repository, which makes PHP a poor option to
write desktop applications.


> The obvious compromise is an embedded app
> that uses PHP to write pages to an internal browser rendering engine but
> html has its limitations and damned if I'm wanting to get involved in
> javascript.

PHP was made for the web and it's where it has it's strengths and to
make things faster and smother javascript will be a part of your life.


If you want something cross-platform, then look at mono, sure it's
larger to install than PHP, but the benefit is that you can make
applications that will run on multiple platforms.

--

//Aho
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180259 is a reply to message #180258] Sun, 03 February 2013 11:50 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 03/02/13 11:44, J.O. Aho wrote:
> On 03/02/13 12:20, crankypuss wrote:
>
>> The big question in my sick mind is whether to build a distro that uses
>> PHP as its primary scripting language or build a new language that's
>> what PHP could have been if it hadn't been mucked-about by all and
>> sundry who gave it functions like is_array() and isset() and when a
>> language doesn't even have consistent naming conventions well there ya
>> go. <g>
>
> There are loads of scripting languages, but you will always know that a
> Linux (including Unix too) will have a shell installed, which makes the
> shell scripting a lot more popular for you don't have to install another
> dependency to be able to run. If REXX been built in by default in the
> Linux/Unix world, then it would have been as popular for scripting as
> Arexx in the Amiga community and replacing shell scripting with
> something else will be something just for your own distro.
>
> One thing talking against PHP is the memory leaking that happens over
> time, writing a daemon you will have it to eat up memory and need to be
> restarted and it don't help to use unset() every time you are finished
> with a variable.
>
>
>> Then they stuck on some OOP functionality and OOP is what everybody
>> thinks is the hot item but it's clumsier than hell to have to pass
>> around a this-pointer and you can't slip another layer into an existing
>> class derivation without rewriting half the world.
>
> Nothing forces you to use OOP, OOP has it's beauties, but not always the
> optimal way to write the code.
>
>
>> Of course at the same time there's the struggle over screen i/o,
>> everybody and his brother wants GUI which is fine except that character
>> mode has its uses as well.
>
> Sure you can write desktop applications in PHP, but not all OS:es has
> gtk/qt/ncurses bindings and not all Linux distributions has those
> available from the official repository, which makes PHP a poor option to
> write desktop applications.
>
>
>> The obvious compromise is an embedded app
>> that uses PHP to write pages to an internal browser rendering engine but
>> html has its limitations and damned if I'm wanting to get involved in
>> javascript.
>
> PHP was made for the web and it's where it has it's strengths and to
> make things faster and smother javascript will be a part of your life.
>
>
> If you want something cross-platform, then look at mono, sure it's
> larger to install than PHP, but the benefit is that you can make
> applications that will run on multiple platforms.
>
java is probably the most popular cross platform interpreted language.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180260 is a reply to message #180252] Sun, 03 February 2013 12:00 Go to previous messageGo to next message
DanS is currently offline  DanS
Messages: 4
Registered: February 2013
Karma: 0
Junior Member
On Sun, 03 Feb 2013 03:45:41 -0700, crankypuss wrote:

> On 02/02/2013 01:57 PM, DanS wrote:
>> On Sat, 02 Feb 2013 13:27:45 -0700, crankypuss wrote:
>>
>>> (Apologies for the cross-post.)
>>>
>>> I don't like bash, haven't seen anything that crude since back in the
>>> days when I was writing FORTRAN and BASIC, so I've been writing all of
>>> my local applications in PHP.
>>>
>>> The folks who frequent comp.lang.php seem to be pretty web-centric
>>> which makes sense as far as that goes. The folks who frequent the
>>> various Linux fora seem pretty bash-centric which also makes sense as
>>> far as that goes.
>>>
>>> As an aside, I've been using Linux for long enough now to realize how
>>> shell-centric it is as an operating system; I'm somewhat blown away by
>>> that but it too makes its own kind of sense.
>>>
>>> Is there a forum where the other folks (presuming there are any) who
>>> have been writing applications in PHP hang out? Don't say "yeah
>>> dummy, go to comp.lang.python" please, my homor quotient is maxed out
>>> for today. <g>
>>
>> Are you talking desktop applications?
>
> Mostly.
>
>> And what kind of applications?
>
> Whatever.
>
>
>> http://stackoverflow.com/questions/40870/why-dont-people-use-php-for-
>> desktop-applications
>>
>> http://www.wisecodes.com/2009/03/create-php-desktop-applications-
>> calculator/
>>
>> http://www.developertutorials.com/tutorials/php/building-desktop-
>> applications-in-php-8-02-01-934/
>>
>> See what people are contributing for PHP at PlanetSourceCode.com:
>>
>> http://www.planetsourcecode.com/vb/default.asp?lngWId=8
>>
>>
> The last thing I want is more shitsucking web forums, but thanks anyway.
>
> Discussion does not happen in web forums, the clumsiness of the
> mechanism prohibits it.

Well if you haven't found discussions of what you're looking for on
Usenet, what else is there?

(However, I do agree that web forums usually do suck. Mainly because
they usually show no hierarchy and all posts appear just one after
another.)
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180261 is a reply to message #180259] Sun, 03 February 2013 12:47 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
On 03/02/13 12:50, The Natural Philosopher wrote:

>> If you want something cross-platform, then look at mono, sure it's
>> larger to install than PHP, but the benefit is that you can make
>> applications that will run on multiple platforms.
>>
> java is probably the most popular cross platform interpreted language.
>
>
Sure it is, but also the one which has been struggling with security
issues and do not feel to be something to recommend nowadays, but lets
see if Oracle has the will to fix the issues.

I have to say I feel C# applications on Linux to be smother than Java,
but then I don't use much of either.

--

//Aho
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180262 is a reply to message #180251] Sun, 03 February 2013 13:08 Go to previous messageGo to next message
J G Miller is currently offline  J G Miller
Messages: 11
Registered: February 2013
Karma: 0
Junior Member
On Sunday, February 3rd, 2013, at 10:58:04h +0100, M. Strobel wrote:

> But in system administration the bash is the shell that starts Linux up.

Most of the major distributions do not use bash as the startup shell,
but dash to provide a Bourne shell (not Bourne Again shell).
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180263 is a reply to message #180246] Sun, 03 February 2013 13:17 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article <kejss302gi7(at)news6(dot)newsguy(dot)com>,
crankypuss <noemail(at)noemail(dot)invalid> wrote:

> (Apologies for the cross-post.)
>
> I don't like bash, haven't seen anything that crude since back in the
> days when I was writing FORTRAN and BASIC, so I've been writing all of
> my local applications in PHP.

Quite right too. Life's too short to fart about with types and
line-noise masquerading as a shell script.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180264 is a reply to message #180261] Sun, 03 February 2013 13:23 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 03/02/13 12:47, J.O. Aho wrote:
> On 03/02/13 12:50, The Natural Philosopher wrote:
>
>>> If you want something cross-platform, then look at mono, sure it's
>>> larger to install than PHP, but the benefit is that you can make
>>> applications that will run on multiple platforms.
>>>
>> java is probably the most popular cross platform interpreted language.
>>
>>
> Sure it is, but also the one which has been struggling with security
> issues and do not feel to be something to recommend nowadays, but lets
> see if Oracle has the will to fix the issues.
>
No argument with that: I merely said it was popular.

> I have to say I feel C# applications on Linux to be smother than Java,
> but then I don't use much of either.
>

frankly if I were coding anything for a Linux desktop I'd use C/C++.

Mostly because the support is guaranteed, the libraries will all be
there, and that's what most of the rest is written in.



--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180265 is a reply to message #180262] Sun, 03 February 2013 13:49 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 03.02.2013 14:08, schrieb J G Miller:
> On Sunday, February 3rd, 2013, at 10:58:04h +0100, M. Strobel wrote:
>
>> But in system administration the bash is the shell that starts Linux up.
>
> Most of the major distributions do not use bash as the startup shell,
> but dash to provide a Bourne shell (not Bourne Again shell).
>

And in which distributions /bin/sh is not a link to /bin/bash?

/Str.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180266 is a reply to message #180265] Sun, 03 February 2013 14:16 Go to previous messageGo to next message
John Hasler is currently offline  John Hasler
Messages: 5
Registered: February 2013
Karma: 0
Junior Member
M. Strobel writes:
> And in which distributions /bin/sh is not a link to /bin/bash?

Debian and derivatives. Debian has used Dash for some years.
--
John Hasler
jhasler(at)newsguy(dot)com
Dancing Horse Hill
Elmwood, WI USA
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180267 is a reply to message #180253] Sun, 03 February 2013 15:17 Go to previous messageGo to next message
Jonathan N. Little is currently offline  Jonathan N. Little
Messages: 12
Registered: February 2011
Karma: 0
Junior Member
crankypuss wrote:
> On 02/02/2013 02:27 PM, Jonathan N. Little wrote:
>> crankypuss wrote:
>>> (Apologies for the cross-post.)
>>>
>>> I don't like bash, haven't seen anything that crude since back in the
>>> days when I was writing FORTRAN and BASIC, so I've been writing all of
>>> my local applications in PHP.
>>>
>>> The folks who frequent comp.lang.php seem to be pretty web-centric which
>>> makes sense as far as that goes. The folks who frequent the various
>>> Linux fora seem pretty bash-centric which also makes sense as far as
>>> that goes.
>>
>> Because for the web is where PHP originated. Get data, do something,
>> done. Not really suited for event driven apps.
>
> I have code that says you're mistaken.


I don't think so. Since its original name was "Personal Home Page Tools"
for scripts to facilitate created personal webpages on a server speaks
to its origins. How an application interacts in with the user from a
webserver is very different from that of a desktop application. That
said, PHP is one of the easiest languages to get started on. I use it a
lot but never liked it double-butt-load of core commands, I mean com'on
PHP gods have you not ever hear of a command parameter? How many in
PHP's gaggle of "sort" commands vs Perl one: sort?

>
>> Late comer to acquiring
>> programming features like OOP. But it is evolving and things may change.
>
> OOP is the worst thing that happened to PHP since mySQL.
>
>>>
>>> As an aside, I've been using Linux for long enough now to realize how
>>> shell-centric it is as an operating system; I'm somewhat blown away by
>>> that but it too makes its own kind of sense.
>>
>> I found bash so useful and powerful and confusing a bit at times. Beats
>> the stuffing out of MS batch files and easier than powershell for me.
>
> MS batch files, lol.

You can get some things done, but it takes a lot of kung-foo!

> Not familiar with powershell.

Single word, "ugh".

>
>>>
>>> Is there a forum where the other folks (presuming there are any) who
>>> have been writing applications in PHP hang out? Don't say "yeah dummy,
>>> go to comp.lang.python" please, my homor quotient is maxed out for
>>> today. <g>
>>
>> Because the python, perl, bash, c, and c++ is what is generally used.
>
> So it goes, eh? Everybody does what everybody has always done.

I have been looking at python since there seems to be so much
development in that direction, but <groan> another language to
learn...maybe not so bad since the syntax is so different, unlike the
problems I suffer when I switch back and forth between Perl and PHP.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180268 is a reply to message #180266] Sun, 03 February 2013 15:28 Go to previous messageGo to next message
Richard Kettlewell is currently offline  Richard Kettlewell
Messages: 7
Registered: September 2010
Karma: 0
Junior Member
John Hasler <jhasler(at)newsguy(dot)com> writes:
> M. Strobel writes:

>> And in which distributions /bin/sh is not a link to /bin/bash?
> Debian and derivatives. Debian has used Dash for some years.

“is not a link to bash” is a little strong - /bin/sh could easily be
either dash or bash on a Debian system. I have systems with both
configurations, for instance.

(And on any given system the operator may have done something else
again.)

--
http://www.greenend.org.uk/rjk/
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180269 is a reply to message #180268] Sun, 03 February 2013 15:39 Go to previous messageGo to next message
John Hasler is currently offline  John Hasler
Messages: 5
Registered: February 2013
Karma: 0
Junior Member
I wrote:
> Debian and derivatives. Debian has used Dash for some years.

Richard Kettlewell writes:
> “is not a link to bash” is a little strong - /bin/sh could easily be
> either dash or bash on a Debian system. I have systems with both
> configurations, for instance.

You can change it to whatever you want, of course, but it has been Dash
by default for years.
--
John Hasler
jhasler(at)newsguy(dot)com
Dancing Horse Hill
Elmwood, WI USA
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180270 is a reply to message #180266] Sun, 03 February 2013 16:50 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 03.02.2013 15:16, schrieb John Hasler:
> M. Strobel writes:
>> And in which distributions /bin/sh is not a link to /bin/bash?
>
> Debian and derivatives. Debian has used Dash for some years.
>

Oh, and I have an Ubuntu here and did not notice. Dash is presumably faster, but is
only sh compatible. And the change forced people to adhere to the lower sh standards.

I would have tried to optimize bash, but then the shell syntax is awkward anyway.
Better use a full scripting language.

Size comparison executable plus linked libraries in Ubuntu 12.04:
dash 2021K
bash 3016K
tclsh 4191K
perl 4637K
python 8349K
PHP 17167K

/Str.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180273 is a reply to message #180270] Sun, 03 February 2013 17:24 Go to previous messageGo to next message
John Hasler is currently offline  John Hasler
Messages: 5
Registered: February 2013
Karma: 0
Junior Member
M. Strobel writes:
> Oh, and I have an Ubuntu here and did not notice.

As I said: Debian derivatives.

> Dash is presumably faster, but is only sh compatible. And the change
> forced people to adhere to the lower sh standards.

Bash is still an essential package and so always present. Maintainers
are free to use it in scripts. They just have to call it explicitly.
Bash is also the default login shell.
--
John Hasler
jhasler(at)newsguy(dot)com
Dancing Horse Hill
Elmwood, WI USA
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180276 is a reply to message #180267] Sun, 03 February 2013 18:40 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 02/03/2013 08:17 AM, Jonathan N. Little wrote:
> crankypuss wrote:
>> On 02/02/2013 02:27 PM, Jonathan N. Little wrote:
>>> crankypuss wrote:
>>>> (Apologies for the cross-post.)
>>>>
>>>> I don't like bash, haven't seen anything that crude since back in the
>>>> days when I was writing FORTRAN and BASIC, so I've been writing all of
>>>> my local applications in PHP.
>>>>
>>>> The folks who frequent comp.lang.php seem to be pretty web-centric
>>>> which
>>>> makes sense as far as that goes. The folks who frequent the various
>>>> Linux fora seem pretty bash-centric which also makes sense as far as
>>>> that goes.
>>>
>>> Because for the web is where PHP originated. Get data, do something,
>>> done. Not really suited for event driven apps.
>>
>> I have code that says you're mistaken.
>
>
> I don't think so. Since its original name was "Personal Home Page Tools"
> for scripts to facilitate created personal webpages on a server speaks
> to its origins. How an application interacts in with the user from a
> webserver is very different from that of a desktop application.

It's okay if we disagree on this, you're allowed to be incorrect. <G>

As for how users interact with applications, if you think it's different
on the web vs on the desktop, I would claim that you haven't finished
generalizing your view of it. In either case the application presents
something, the user responds, rinse-and-repeat. The main difference
between a web-app and a desktop-app is the level of precision provided
by the interface and the amount of latency. I've built web-apps that
run equally well on the desktop. If you aren't aware of it, there is
(or, was) a guy in the Windows world who sells a shareware product to
facilitate writing desktop applications in PHP.

I'm not sure but I think it used to be available here,
http://www.desktopsolutions.com/
but he/they seem not to offer the package anymore, preferring to make
money providing services. It's been years, and I don't recall for sure
where I got the thing. It could have been this but I think this is
something new:

http://www.nusphere.com/products/phpdock.htm

Oooh, lookit what I found while looking for that link!
http://code.google.com/p/phpdesktop/

> That
> said, PHP is one of the easiest languages to get started on. I use it a
> lot but never liked it double-butt-load of core commands, I mean com'on
> PHP gods have you not ever hear of a command parameter? How many in
> PHP's gaggle of "sort" commands vs Perl one: sort?

The language has been hacked almost to death, yeah.

OTOH, when I think about going back and re-learning C, which I never
*really* learned well since I skipped from Assembler to C++, and then
dropped C++ as a bag-o-crap... it's like considering the idea of
spending money to hook up with your ex-wife's mother or something
equally disgusting.

>>> Late comer to acquiring
>>> programming features like OOP. But it is evolving and things may change.
>>
>> OOP is the worst thing that happened to PHP since mySQL.
>>
>>>>
>>>> As an aside, I've been using Linux for long enough now to realize how
>>>> shell-centric it is as an operating system; I'm somewhat blown away by
>>>> that but it too makes its own kind of sense.
>>>
>>> I found bash so useful and powerful and confusing a bit at times. Beats
>>> the stuffing out of MS batch files and easier than powershell for me.
>>
>> MS batch files, lol.
>
> You can get some things done, but it takes a lot of kung-foo!
>
>> Not familiar with powershell.
>
> Single word, "ugh".
>
>>
>>>>
>>>> Is there a forum where the other folks (presuming there are any) who
>>>> have been writing applications in PHP hang out? Don't say "yeah dummy,
>>>> go to comp.lang.python" please, my homor quotient is maxed out for
>>>> today. <g>
>>>
>>> Because the python, perl, bash, c, and c++ is what is generally used.
>>
>> So it goes, eh? Everybody does what everybody has always done.
>
> I have been looking at python since there seems to be so much
> development in that direction, but <groan> another language to
> learn...maybe not so bad since the syntax is so different, unlike the
> problems I suffer when I switch back and forth between Perl and PHP.
>

PHP has a few advantages. Lots of people use it for web-apps so there
are more PHP programmers out there than programmers for a
new-as-yet-untested language. If you can make your way through all the
gross crap, you can find a pony underneath. And syntactically it isn't
that difficult to automatically transliterate to some
new-as-yet-untested language. The language itself has some decent
features, reminiscent of Rexx. It ain't great but it's sufficient, imo.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180277 is a reply to message #180259] Sun, 03 February 2013 18:43 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 02/03/2013 04:50 AM, The Natural Philosopher wrote:
> On 03/02/13 11:44, J.O. Aho wrote:
>> On 03/02/13 12:20, crankypuss wrote:
>>
>>> The big question in my sick mind is whether to build a distro that uses
>>> PHP as its primary scripting language or build a new language that's
>>> what PHP could have been if it hadn't been mucked-about by all and
>>> sundry who gave it functions like is_array() and isset() and when a
>>> language doesn't even have consistent naming conventions well there ya
>>> go. <g>
>>
>> There are loads of scripting languages, but you will always know that a
>> Linux (including Unix too) will have a shell installed, which makes the
>> shell scripting a lot more popular for you don't have to install another
>> dependency to be able to run. If REXX been built in by default in the
>> Linux/Unix world, then it would have been as popular for scripting as
>> Arexx in the Amiga community and replacing shell scripting with
>> something else will be something just for your own distro.
>>
>> One thing talking against PHP is the memory leaking that happens over
>> time, writing a daemon you will have it to eat up memory and need to be
>> restarted and it don't help to use unset() every time you are finished
>> with a variable.
>>
>>
>>> Then they stuck on some OOP functionality and OOP is what everybody
>>> thinks is the hot item but it's clumsier than hell to have to pass
>>> around a this-pointer and you can't slip another layer into an existing
>>> class derivation without rewriting half the world.
>>
>> Nothing forces you to use OOP, OOP has it's beauties, but not always the
>> optimal way to write the code.
>>
>>
>>> Of course at the same time there's the struggle over screen i/o,
>>> everybody and his brother wants GUI which is fine except that character
>>> mode has its uses as well.
>>
>> Sure you can write desktop applications in PHP, but not all OS:es has
>> gtk/qt/ncurses bindings and not all Linux distributions has those
>> available from the official repository, which makes PHP a poor option to
>> write desktop applications.
>>
>>
>>> The obvious compromise is an embedded app
>>> that uses PHP to write pages to an internal browser rendering engine but
>>> html has its limitations and damned if I'm wanting to get involved in
>>> javascript.
>>
>> PHP was made for the web and it's where it has it's strengths and to
>> make things faster and smother javascript will be a part of your life.
>>
>>
>> If you want something cross-platform, then look at mono, sure it's
>> larger to install than PHP, but the benefit is that you can make
>> applications that will run on multiple platforms.
>>
> java is probably the most popular cross platform interpreted language.
>
>

And McDonalds probably sells more bad hamburgers than anybody else.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180278 is a reply to message #180276] Sun, 03 February 2013 19:00 Go to previous messageGo to next message
Jonathan N. Little is currently offline  Jonathan N. Little
Messages: 12
Registered: February 2011
Karma: 0
Junior Member
crankypuss wrote:
> On 02/03/2013 08:17 AM, Jonathan N. Little wrote:

<snip>

>> I don't think so. Since its original name was "Personal Home Page Tools"
>> for scripts to facilitate created personal webpages on a server speaks
>> to its origins. How an application interacts in with the user from a
>> webserver is very different from that of a desktop application.
>
> It's okay if we disagree on this, you're allowed to be incorrect. <G>

Not sure even if a smile can change history though.

>
> As for how users interact with applications, if you think it's different
> on the web vs on the desktop, I would claim that you haven't finished
> generalizing your view of it. In either case the application presents
> something, the user responds, rinse-and-repeat. The main difference
> between a web-app and a desktop-app is the level of precision provided
> by the interface and the amount of latency. I've built web-apps that
> run equally well on the desktop. If you aren't aware of it, there is
> (or, was) a guy in the Windows world who sells a shareware product to
> facilitate writing desktop applications in PHP.

But how it "runs" is different. A desktop app starts and has a message
loop that checks for user interaction. Responds and continues until
either program, user, or system terminates the processes. With the web
the php script receives its input via the web server, script runs and
does its stuff, creates the web page and terminates.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180279 is a reply to message #180273] Sun, 03 February 2013 19:25 Go to previous messageGo to next message
J G Miller is currently offline  J G Miller
Messages: 11
Registered: February 2013
Karma: 0
Junior Member
On Sunday, February 3rd, 2013, at 11:24:04h -0600, John Hasler wrote:

> M. Strobel writes:
>> Oh, and I have an Ubuntu here and did not notice.
>
> As I said: Debian derivatives.
>
>> Dash is presumably faster, but is only sh compatible. And the change
>> forced people to adhere to the lower sh standards.
>
> Bash is still an essential package and so always present.

Indeed so and nobody is or should be arguing otherwise.

The point raised was solely with respect to
"bash is the shell that starts Linux up."

> Maintainers are free to use it in scripts.

Certainly not boot time scripts and it appears that it
is frowned upon for other scripts.

<http://lintian.debian.org/tags/possible-bashism-in-maintainer-script.html>

Ubuntu also adopted the policy of not using bashisms in startup scripts.

<https://wiki.ubuntu.COM/DashAsBinSh>

> Bash is also the default login shell.

But can easily be changed to tcsh for the users. ;)
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180281 is a reply to message #180279] Sun, 03 February 2013 20:25 Go to previous messageGo to next message
Richard Kettlewell is currently offline  Richard Kettlewell
Messages: 7
Registered: September 2010
Karma: 0
Junior Member
J G Miller <miller(at)yoyo(dot)ORG> writes:
> John Hasler wrote:

>> Maintainers are free to use it in scripts.
>
> Certainly not boot time scripts and it appears that it
> is frowned upon for other scripts.
>
> <http://lintian.debian.org/tags/possible-bashism-in-maintainer-script.html>
>
> Ubuntu also adopted the policy of not using bashisms in startup scripts.
>
> <https://wiki.ubuntu.COM/DashAsBinSh>

Neither of those pages contain instructions to avoid Bash. They just
tell you not to use Bashisms in scripts starting “#!/bin/sh”.

Notice for instance that (at least in sid) dash.preinst is a #!/bin/bash
script, but dash doesn’t appear on the lintian page.

--
http://www.greenend.org.uk/rjk/
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180282 is a reply to message #180279] Sun, 03 February 2013 20:26 Go to previous messageGo to next message
John Hasler is currently offline  John Hasler
Messages: 5
Registered: February 2013
Karma: 0
Junior Member
I wrote:
> [Debian] maintainers are free to use [Bash] in scripts.

J G Miller writes:
> Certainly not boot time scripts and it appears that it
> is frowned upon for other scripts.

From the Debian Policy Manual:

All command scripts, including the package maintainer scripts inside
the package and used by dpkg, should have a #! line naming the shell
to be used to interpret them. In the case of Perl scripts this
should be #!/usr/bin/perl.

....

Shell scripts (sh and bash) other than init.d scripts should almost
certainly start with set -e so that errors are detected. init.d
scripts are something of a special case, due to how frequently they
need to call commands that are allowed to fail, and it may instead be
easier to check the exit status of commands directly. See Writing the
scripts, Section 9.3.2 for more information about writing init.d
scripts.

...

If a shell script requires non-SUSv3 features from the shell
interpreter other than those listed above, the appropriate shell must
be specified in the first line of the script (e.g., #!/bin/bash) and
the package must depend on the package providing the shell (unless
the shell package is marked "Essential", as in the case of bash).

...

If in doubt whether a script complies with these requirements, use
/bin/bash.

...

csh and tcsh should be avoided as scripting languages.
--
John Hasler
jhasler(at)newsguy(dot)com
Dancing Horse Hill
Elmwood, WI USA
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180283 is a reply to message #180281] Sun, 03 February 2013 21:47 Go to previous messageGo to next message
J G Miller is currently offline  J G Miller
Messages: 11
Registered: February 2013
Karma: 0
Junior Member
On Sunday, February 3rd, 2013, at 20:25:39h +0000, Richard Kettlewell wrote:

> Neither of those pages contain instructions to avoid Bash.

But this tends to suggest that bash should be avoided if possible.

From <http://www.debian.org/doc/debian-policy/ch-files.html>

QUOTE

You may wish to restrict your script to SUSv3 features plus the above set when
possible so that it may use /bin/sh as its interpreter. Checking your script
with checkbashisms from the devscripts package or running your script with an
alternate shell such as posh may help uncover violations of the above requirements.
If in doubt whether a script complies with these requirements, use /bin/bash.

UNQUOTE

> Notice for instance that (at least in sid) dash.preinst is a #!/bin/bash
> script, but dash doesn’t appear on the lintian page.

Well Debianistas do not always follow their own recommendations,
do they? ;)

{init.d/}# ls -1 | wc -l
120

{init.d/}# grep bash *
acpi-support:#!/bin/bash
console-log:#! /bin/bash
nfs-kernel-server:#!/bin/bash

{init.d}# grep '#! */bin/sh' * | wc -l
120
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180284 is a reply to message #180278] Sun, 03 February 2013 21:56 Go to previous messageGo to next message
Richard Yates is currently offline  Richard Yates
Messages: 86
Registered: September 2013
Karma: 0
Member
On Sun, 03 Feb 2013 14:00:55 -0500, "Jonathan N. Little"
<lws4art(at)gmail(dot)com> wrote:

> crankypuss wrote:
>> On 02/03/2013 08:17 AM, Jonathan N. Little wrote:
>
> <snip>
>
>>> I don't think so. Since its original name was "Personal Home Page Tools"
>>> for scripts to facilitate created personal webpages on a server speaks
>>> to its origins. How an application interacts in with the user from a
>>> webserver is very different from that of a desktop application.
>>
>> It's okay if we disagree on this, you're allowed to be incorrect. <G>
>
> Not sure even if a smile can change history though.

Especially when the tag is never closed!
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180285 is a reply to message #180283] Sun, 03 February 2013 22:32 Go to previous messageGo to next message
John Hasler is currently offline  John Hasler
Messages: 5
Registered: February 2013
Karma: 0
Junior Member
Debian Policy is a standard for Debian maintainers and follows the usual
conventions. "You may wish" is not a synonym for "shall" or even for
"should".
--
John Hasler
jhasler(at)newsguy(dot)com
Dancing Horse Hill
Elmwood, WI USA
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180286 is a reply to message #180283] Sun, 03 February 2013 22:59 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 03/02/13 21:47, J G Miller wrote:
> On Sunday, February 3rd, 2013, at 20:25:39h +0000, Richard Kettlewell wrote:
>
>> Neither of those pages contain instructions to avoid Bash.
>
> But this tends to suggest that bash should be avoided if possible.
>
> From <http://www.debian.org/doc/debian-policy/ch-files.html>
>
> QUOTE
>
> You may wish to restrict your script to SUSv3 features plus the above set when
> possible so that it may use /bin/sh as its interpreter. Checking your script
> with checkbashisms from the devscripts package or running your script with an
> alternate shell such as posh may help uncover violations of the above requirements.
> If in doubt whether a script complies with these requirements, use /bin/bash.
>
> UNQUOTE
>
>> Notice for instance that (at least in sid) dash.preinst is a #!/bin/bash
>> script, but dash doesn’t appear on the lintian page.
>
> Well Debianistas do not always follow their own recommendations,
> do they? ;)
>
> {init.d/}# ls -1 | wc -l
> 120
>
> {init.d/}# grep bash *
> acpi-support:#!/bin/bash
> console-log:#! /bin/bash
> nfs-kernel-server:#!/bin/bash
>
> {init.d}# grep '#! */bin/sh' * | wc -l
> 120
>
That's amazing! 120-3 = 120!


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180287 is a reply to message #180283] Sun, 03 February 2013 23:13 Go to previous messageGo to next message
Richard Kettlewell is currently offline  Richard Kettlewell
Messages: 7
Registered: September 2010
Karma: 0
Junior Member
J G Miller <miller(at)yoyo(dot)ORG> writes:
> Richard Kettlewell wrote:

>> Neither of those pages contain instructions to avoid Bash.
>
> But this tends to suggest that bash should be avoided if possible.
>
> From <http://www.debian.org/doc/debian-policy/ch-files.html>
>
> QUOTE
>
> You may wish to restrict your script to SUSv3 features plus the above
> set when possible so that it may use /bin/sh as its
> interpreter. Checking your script with checkbashisms from the
> devscripts package or running your script with an alternate shell
> such as posh may help uncover violations of the above requirements.
> If in doubt whether a script complies with these requirements, use
> /bin/bash.
>
> UNQUOTE

You seem to be reading “you may wish to” as “you should”, and perhaps to
have had trouble reading the “if in doubt” part at all.

--
http://www.greenend.org.uk/rjk/
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180288 is a reply to message #180286] Mon, 04 February 2013 00:21 Go to previous messageGo to next message
J G Miller is currently offline  J G Miller
Messages: 11
Registered: February 2013
Karma: 0
Junior Member
On Sunday, February 3rd, 2013, at 22:59:15h +0000,
The Natural Philosopher wrote:

> That's amazing! 120-3 = 120!

My cut 'n' paste went wrong.

ls -1 | wc -l
123
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180289 is a reply to message #180278] Mon, 04 February 2013 00:53 Go to previous messageGo to next message
Martin is currently offline  Martin
Messages: 8
Registered: October 2010
Karma: 0
Junior Member
On 02/03/2013 08:00 PM, Jonathan N. Little wrote:

>>> I don't think so. Since its original name was "Personal Home Page Tools"
>>> for scripts to facilitate created personal webpages on a server speaks
>>> to its origins. How an application interacts in with the user from a
>>> webserver is very different from that of a desktop application.
>>
>> It's okay if we disagree on this, you're allowed to be incorrect. <G>
>
> Not sure even if a smile can change history though.

you're totally right, PHP started out as "Private Home Page" and was
designed as an inline script for HTML templates, just like all the other
"XYZ Server Pages" in the early days.

For those with a sense of humour there is this comparison between perl
and PHP:

http://tnx.nl/php.html
Re: anyone else writing Linux (or cross-system) applications in PHP? [message #180290 is a reply to message #180289] Mon, 04 February 2013 02:40 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 04/02/13 00:53, Martin wrote:
> On 02/03/2013 08:00 PM, Jonathan N. Little wrote:
>
>>>> I don't think so. Since its original name was "Personal Home Page
>>>> Tools"
>>>> for scripts to facilitate created personal webpages on a server speaks
>>>> to its origins. How an application interacts in with the user from a
>>>> webserver is very different from that of a desktop application.
>>>
>>> It's okay if we disagree on this, you're allowed to be incorrect. <G>
>>
>> Not sure even if a smile can change history though.
>
> you're totally right, PHP started out as "Private Home Page" and was
> designed as an inline script for HTML templates, just like all the other
> "XYZ Server Pages" in the early days.
>
> For those with a sense of humour there is this comparison between perl
> and PHP:
>
> http://tnx.nl/php.html
>
>
yerrs. its like comparing cat shit to dog crap. Really if its on your
shoe, who gives a damn?


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Pages (3): [1  2  3    »]  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem with readdir and ssh2
Next Topic: web designers and developers
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 13:42:12 GMT 2024

Total time taken to generate the page: 0.04677 seconds