php-gtk file extension
| From: | Christian Weiske | Date: | Tue, 04 Nov 2003 15:28:39 +0000 |
| Subject: | php-gtk file extension | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-4055@lists.php.net to get a copy of this message | ||
Hi
Today I want to tell you my thoughts about a default file extension for
php-gtk applications.
For the people who don't know what this is: The extension is the string
after the last dot of a file name, e.g. the file "my word document 2.
version.doc" has the extension "doc".
You may think: "Why do I need a default extension? I see the files and
see what file to start - it easy, just 'php filename.<extension>'".
That's right. But with this proceeding, you assume several things:
- The path to the php executable has to be in the PATH environment
variable
- The _user_ has to be skilled enough to regognize what file to start -
and I mean "user", not developer or power user
- You need a shell to type the command
"But hey, PHP installations with apache is mostly used on *nix, everyone
has a shell! And if *nix is used, the user is skilled enough"
The 2nd argument is right. If you're on *nix, you probably know what to
do. But if you're there, you don't need a GUI...
PHP-Gtk has been created to give the developer a powerful,
lightweight(?) and easy to use language where he can easily create GUIs
with.
But GUIs are mostly used on desktop computers, not on servers. And the
operating system installed on desktops is with a 90% chance - µ$oft
windows. So the probability is high that the PHP-Gtk applications are
used on windows, and the app should work there, too.
Windows itself is a graphical system with a shell as extension, not as
base. Now you all know the average windows user knowing how to run word
and iexplore. Does he know how to open a shell and type "php
filename.<extension>"? He won't even know what a shell is, and if he
opens the command window, he don't know how to change the path.
"Ok, but that's not my audience!"
Maybe. But if the program runs on windows, why keep the not-so-skilled
users from using it? Perhaps it could be useful for them. And there will
be some programs which have the average user as target group.
Everyone is a bit lazy, and would you mind running a often used
application with one click? Probably no.
"If I need this, I make a shortcut with the full 'php ...' command."
Just imagine you're trying out a new php-gtk app - for this one you've
got no shortcut.
"Wouldn't it be more easy to ship a batch file for the windows users
which they can double-click?"
No. The php path has to be in the PATH environment variable, otherwise
it wont work - unless you assume a fixed php-gtk directory. But this is
daydreaming; nearly all installations are different on windows.
Another solution would be to add a command to the context menu of all
files "exeute as php-gtk application", because you don't know what
extension the developer has used or will be using for his next program.
Believe me or not, many users are accustomed to extensions, even if they
don't know what a file extension is - windows handles this for them.
Double-click a word document, and it is opened with word. The same for
images, other document formats and so on.
It's a very easy concept: The extension of a file is determined, and the
application registered for this filetype is started and opens the
document you double-clicked. Easy, fast and wonderful.
You as a php-gtk programmer might have another problem:
The application you're writing needs to run another program - a php-gtk
one. How to do this? Just "exec php <programname>.<extension>". Now the
problem with the php path comes up.
The conclusion:
A standard php-gtk file extension would be very useful. It has following
advantages:
- Run php-gtk applications with ease, even fresh downloaded ones
- All php-gtk programs have the same icon, the user will re-recognize a
new php-gtk script as a runnable application faster
- You can run php-gtk applications just with "exec
<scriptname>.<extension>", because windows knows that it shall open it
with php-gtk
For that reasons I would like to see a fixed file extension for
executable php-gtk scripts. Normal class and include files shall keep
".inc" or ".php" because they can't be started.
I vote for ".php-gtk" - it's the most obvious thing.
Other developers use things like ".dgk" for "php-gtk application in
development" and ".pgk" for "php-gtk program", but that's too far for
me.
Just the ".php" makes no distinction between "normal" server php files
and desktop php apps.
The fixed extension would make it possible to register the php-gtk file
type already at the php-gtk installation, giving the option to make a
"open in shell" context menu extension for debugging this files.
And the samples shipped with php-gtk can be tested immediately after
installation without the command window.
Think about it.
Regards/MfG,
Christian Weiske
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>
Christian Weiske
cweiske@cweiske.de
www.cweiske.de
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>
Always forgetting birthdays? Try birthday reminder!
http://www.cweiske.de/birthday.htm