コード例 #1
0
ファイル: CLIProgressBar.php プロジェクト: guaykuru/pawtucket
 /**
  * Set the width the rendered text must fit in
  * 
  * @param int $width passed in options
  *
  * @static
  * @return void
  */
 protected static function setWidth($width = null)
 {
     if ($width === null) {
         if (self::$window) {
             ncurses_getmaxyx(self::$window, $vn_max_y, $vn_max_x);
             $width = $vn_max_x - 4;
         } else {
             if (DIRECTORY_SEPARATOR === '/') {
                 $width = `tput cols`;
             }
         }
         if ($width < 80) {
             $width = 80;
         }
     }
     self::$width = $width;
 }
コード例 #2
0
 /**
  * Set the width the rendered text must fit in
  * 
  * @param int $width passed in options
  *
  * @static
  * @return void
  */
 protected static function setWidth($width = null)
 {
     $height = null;
     if ($width === null) {
         if (self::$window) {
             ncurses_getmaxyx(self::$window, $width, $height);
             $width = 96;
         } else {
             if (DIRECTORY_SEPARATOR === '/') {
                 $width = `tput cols`;
             }
         }
         if ($width < 80) {
             $width = 80;
         }
     }
     self::$width = $width;
 }