New backup format with commands in CLI.

This commit is contained in:
Alexandre Rosenfeld
2011-01-14 23:11:13 +00:00
parent 08322a9dfa
commit 9a1c414455
4 changed files with 425 additions and 88 deletions

View File

@@ -1,4 +1,13 @@
<?php
/* Get the size of the terminal (only works on Linux, on Windows it's always 80) */
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
if(sizeof($output) == 3) {
define("COLUMNS", $output[2][0]);
} else {
define("COLUMNS", 80);
}
/**
* From http://www.php.net/manual/en/function.getopt.php#83414
* Parses $args for parameters and assigns them to an array.