Banshee
the secure PHP framework

Forum

Post installation cleanup - ncurses error

Mike
30 march 2011, 16:50
Hi Hugo,

After installing Banshee 3.0, I tried to remove some demo modules.
I got an error saying :
Call to undefined function ncurses_init() in [...]/remove_module.

It turns out that ncurses is no longer part of PHP since version 5.3.

Is ncurses in any way vital to Banshee ?
Will it remain part of your scripts (such as the remove_module script) now that it's apparently thrown out of PHP ?
(I know I could install ncurses, but I'd rather not if I don't have to.)

Banshee version: 3.0
PHP version: 5.3.3
Webserver: Apache (Ubuntu 10.04 Server)
Hugo Leisink
30 march 2011, 19:03
Thanks for letting me know. I will fix this for the next version. In 'remove_module' and 'show_library_api', you can replace the four lines that contain the ncurses_init() call with the following code:

$output = explode(";", exec("stty -a | grep columns"));
$width = 80;
foreach ($output as $line) {
list($key, $value) = explode(" ", ltrim($line), 2);
if ($key == "columns") {
$width = (int)$value;
break;
}
}
Mike
31 march 2011, 14:14
Great, works like a charm.

Thanks!
Message preview

The following BB-codes are available in a message:

  • [b]Bold text[/b]
  • [center]Center text or imagen[/center]
  • [color=color name or #RGB code]Colored text[/color]
  • [i]Italic text[/i]
  • [img]Link to image[/img]
  • [right]Align text or image right[/right]
  • [s]Strike-through text[/s]
  • [size=pixelsize]Big or small text[/size]
  • [u]Underlined text[/u]
  • [url]Link to website[/url]
  • [url=link to website]Link text[/url]