ExeOutput for PHP can create console applications with no GUI. These applications work as if PHP was run in CLI mode.
You can choose whether you want to create a GUI or console application when you start a new project. This choice is definitive! The status bar of ExeOutput for PHP tells you whether you are working with a GUI or console application:
ExeOutput for PHP creates a single and stand-alone executable file: end users just launch the resulting EXE file. No PHP installation is required. All compiled files are automatically fed into the PHP runtime when requested.
A console application cannot prompt for elevated rights: use an administrator command prompt to complete administrative tasks.
exo_get_resstring can be used to protect resource strings.
A lof of ExeOutput for PHP features are NOT handled by console applications: global variables, global protection (security), HEScript scripting…
Do not use
$_SERVER['DOCUMENT_ROOT'] because the $_SERVER variable is empty in a console application (not running on a server and it is not processing an HTTP request).
To get the full path to the EXE dir, use this code:
The following code was used to render the console app whose screenshot is available above.
<?php print ("Hello World from a console app made with ExeOutput for PHP!\n"); print (exo_get_protstring('str1')); fputs(STDOUT, "\nThe Amazing Favourite Colour Script\n"); fputs(STDOUT, "What is your favourite colour? "); $sometext = strtolower(trim(fgets(STDIN, 256))); fputs(STDOUT, "Your favourite colour is $sometext!\n\n"); ?>
Copyright G.D.G. Software 2019. All Rights Reserved.