Пример #1
0
 function exec_command($command)
 {
     echo '<pre>';
     echo '>' . $command . "\n";
     parent::exec_command($command);
     echo '</pre>';
 }
Пример #2
0
 function __construct()
 {
     header('Content-type: text/plain;charset=utf-8');
     ignore_user_abort(false);
     ob_implicit_flush(1);
     ini_set('implicit_flush', true);
     set_error_handler(array(&$this, 'error_handle'));
     chdir('data');
     kernel::$console_output = true;
     while (ob_get_level()) {
         ob_end_flush();
     }
     echo str_repeat("", 1024);
     //$this->buildin_commander = new base_shell_buildin($this);
     parent::__construct();
 }
Пример #3
0
 function progress()
 {
     $i = intval(100 * $this->download / $this->total);
     if (PHP_SAPI == 'cli') {
         $width = base_shell_loader::get_width() - 5;
         $padding = 34;
         $download_width = round($i * ($width - $padding) / 100);
         echo str_repeat(chr(8), $width);
         echo str_pad($i, 2, ' ', STR_PAD_LEFT), '% ', '[', str_repeat('=', $download_width), '>', str_repeat(' ', $width - $padding - $download_width), '] ', str_pad(number_format($this->download, 0, '.', ','), 15), str_pad(number_format($this->speed / 1024, 2, '.', ',') . 'K/s', 10), $this->img();
     } else {
         if ($i > $this->last + 1) {
             for ($j = $this->last + 2; $j <= $i; $j += 2) {
                 echo $j % 10 == 0 ? $j : '.';
             }
             $this->last = $i;
         }
     }
 }