R: [PHP-GTK] Auto Detection of Environment

From: Date: Mon, 13 Dec 2004 14:28:10 +0000
Subject: R: [PHP-GTK] Auto Detection of Environment
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5352@lists.php.net to get a copy of this message
under X (X11,Xorg and others), there is a variable in environment: DISPLAY if you are on xterm you can view that. under windows you are always on graphical interface. (and probably you will want all programs run in a "graphical view"). bye Dimitri Giardina > -----Messaggio originale----- > Da: Richard Thomas [mailto:lists@cyberlot.net] > Inviato: sabato 11 dicembre 2004 18.43 > A: Ciprian Popovici > Cc: php-gtk-general@lists.php.net > Oggetto: Re: [PHP-GTK] Auto Detection of Environment > > > You can't use a check for php_gtk to verify the presense of a > graphical/gtk enabled enviroment. > > The plugin will exist regardless of what enviroment its being run in, > However when you try to run show_all there will be an error, I don't > remember specificly what that was and don't have gtk installed at the > moment to test.. > > To see this, http://gtk.php.net/manual/en/tutorials.hellow.php > run the > hello world from your normal x-windows then ctrl-alt-f1 to terminal mode > and try running it again. > > > Richard Thomas - CEO > > Cyberlot Technologies Group Inc. > > 507.398.4124 - Voice > > > > Ciprian Popovici wrote: > > >On Wed, 8 Dec 2004 21:56:39 -0600 Doug Burkhalter > <dougtheneard@gmail.com> > >wrote: > > > > > >>I'm looking into creating apps with PHP that could be run in three > >>different ways: online, via command line, and through PHP-GTK. I was > >>wondering if there was any "automatic" way to detect what environment > >>it was being run in (online, cli, or GTK). > >> > >> > > > >While on Web, the constant STDIN is not defined, so you can test with > >defined('STDIN'). Next you can test for GTK either with > >extension_loaded('php_gtk') or if that doesn't work use function_exists() > >with a GTK-specific function, or test if the "gtk" class exists, > and so on. > > > > > > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.gtk.general (#5352) next »