Reply
Thread Tools
Lord Raiden's Avatar
Posts: 1,562 | Thanked: 349 times | Joined on Jun 2008
#1
Ok, I've got an idea for several different programs, but I write almost everything these days in PHP with a MySQL backend. Since Apache and MySQL are ported to Maemo, would it be out of line to write some apps specifically for use on OS2008 in PHP and MySQL? And if I were, how would I make them launchable from the menu and include an icon?

Also, would there be a simple way to install and run them (other than opening the browser and entering an address) on the tablet? Like possibly using a php wrapper of some kind? Or would they have to run through the browser?
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#2
It would not be the UNIX way. But it probably wouldn't be "out of line".

I don't know of any other way than the browser, but there might be one.

I'm no packaging / .desktop file wizard, but it should be doable with the browser. Your package will have to depend on Apache and MySQL, of course, to make sure they're installed. If these apps will run well with some available alternative, lightweight browser (I'm thinking Midori, maybe), you might have it as a dependency. But then your apps couldn't get into extras until Midori/whatever does, so I'm not sure it's a good idea.

Then your icons and .desktop files install normally; your .desktop files have to launch a web browser pointing at an address, either the builtin one (browser --url url), or whatever else.
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#3
php scripts can be run from CLI just like Perl, Ruby, Python, take your pick. PHP is just a more generalized and bastardized form of the more powerful scripting languages.. angled specifically for web development... But CLI apps could be done in php.

You can execute any php webpage by just running "php mypage.php" from the CLI and you'll get the HTML output that you would get as if you ran it from a browser. If your program does something other than generate HTML output .. there's no need for the browser to show it to you. (you'll need php5-cli.. dunno if it's been ported.)

Code:
#:~/dvd$ php -r 'echo "hello world\n";'
hello world
#:~/dvd$ perl -e 'print "hello world\n";'
hello world
And to install these apps just make a .desktop file with the CLI command to run said program .. make a DEB package of the .desktop and your php files.. and for the dependencies put php5-cli (or whatever the php port for maemo is) and mysql. That will install the necessary apps.

There is also a way to make your .desktop file launch the program in a terminal .. either xterm or roxterm. Deblet's installer does it... as does Qole's easy debian.

And if you're using LAMP.. just have the .desktop file launch the browser pointed to the http://localhost/mypath/to/my/prettylittleapp
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!

Last edited by fatalsaint; 2008-09-12 at 04:22.
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#4
PHPGTK compiles okay and works, but there's no Hildon port. Also i would use sqlite instead of mysql - small, fast, doesn't need a real server and eats less resources - in other words perfect for the tablet
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
Lord Raiden's Avatar
Posts: 1,562 | Thanked: 349 times | Joined on Jun 2008
#5
How hard is it to work with sqlite? I've done most of my dev backend work with mysql, so I'm just curious. And I could write the frontend in perl and wrap it with a gtk gui, but I'm shooting for the "easiest method first" approach and decided to go PHP since I planned to do websync and other things with it. Plus I do most of my interactive stuff these days in php anyways, hence the thought of using that first over perl.
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#6
Not hard. Quite similar to MySQL, after all they're SQL servers

http://bg.php.net/manual/en/book.sqlite.php

I'm not sure about if Perl-GTK is available on tablet.
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
Posts: 29 | Thanked: 7 times | Joined on Nov 2008 @ France
#7
i took some time trying to play with nginx+php+sqlite, it works fine.
But i really nead an Apache + Mysql + Php.

There are apache2 and php5_cgi, and mysql packages indeed, but no php-mysql support.

I played with maemo-sdk+, but couldn't find a way to compile php5 with mysql support...
 
Reply


 
Forum Jump


All times are GMT. The time now is 04:36.