google-code-backups / add-mvc-framework

Automatically exported from code.google.com/p/add-mvc-framework
0 stars 0 forks source link

New Idea: "Press any key to show shutdown print" #153

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Description Of This Idea:
"Press any key to show shutdown print" to execute the add::handle_shutdown() 
using this kind of code:

php -r "echo 'press enter'; fgets(STDIN); echo 'thank you';"

How Can This Idea Help:
CLI running would be more readable cause shutdown handle tend to drown the 
screen with unimportant error messages

How To Implement This Idea:
some kind of 

add.class.php
{{{
   static function handle_shutdown() {
      if ($on_cli) {
         echo 'press any key to execute shutdown handle';
         fgets(STDIN);
      }
      #...
   }
}}}
Note:
   Check php version requirement
   Check how it looks like to execute this on apache/browser

Original issue reported on code.google.com by albertdi...@gmail.com on 28 Jan 2015 at 5:42

GoogleCodeExporter commented 8 years ago

Original comment by albertdi...@gmail.com on 28 Jan 2015 at 5:43

GoogleCodeExporter commented 8 years ago
But this kind of stops the shutdown handle itself rather than stop the 
printing, which is what we're really up to.

Original comment by albertdi...@gmail.com on 28 Jan 2015 at 5:44

GoogleCodeExporter commented 8 years ago
The halt might not be desireable when running automated scripts

Original comment by albertdi...@gmail.com on 29 Jan 2015 at 5:34

GoogleCodeExporter commented 8 years ago
commit postponed:
add.class.php
{{{

   static function handle_shutdown() {
      if ( php_sapi_name() == "cli" && DEFINED('STDIN')) {
         echo "\n\npress any key to execute shutdown handle\n\n";
         fgets(STDIN);
      }
      #...
    }

}}}

Original comment by albertdi...@gmail.com on 29 Jan 2015 at 6:15