echo "All sizes are in kB. The pack column is the size of the object, compressed, inside the pack file."
-output="size,pack,SHA,location"
+(
+echo "size,pack,SHA,location"
for y in $objects
do
# extract the size in bytes
# find the objects location in the repository tree
other=`git rev-list --all --objects | grep $sha`
#lineBreak=`echo -e "\n"`
- output="${output}\n${size},${compressedSize},${other}"
+ echo "${size},${compressedSize},${other}"
done
+) | column -t -s ', '
-echo -e $output | column -t -s ', '
)
}
return $this->db()->cast_text($name);
}
- public function sql_name() {
+ public function sql_name(bool $cast=false) {
+ if ($cast and !$this->text()) return $this->sql_name_cast_text();
return $this->db()->sql_name($this->name);
}
}
- $name = $field->sql_name();
- if (!$field->text()) $name = $field->sql_name_cast_text();
+ $name = $field->sql_name(true);
+# NB 12.01.18 if (!$field->text()) $name = $field->sql_name_cast_text();
if ($field->extras) {
$k = $this->extras[$k]->sql_name();
}
+ public function maxlengths() {
+# NB 12.01.18 $sql = 'MAX(LENGTH('.$field->sql_name(true).'))';
+ }
+
public function fields_rows() {
$rows = array_values($this->object2array($this->fields()));
$o['_human']['eol'] = $o['eol'];
$o['eol'] = "";
- $o['tmpfile'] = tmpfile();
+ $o['_human']['tmpfile'] = tmpfile();
# no csv echo call
$o['return'] = true;
$i++;
}
- if (!isset($o['tmpfile'])) {
+ if (!isset($o['_human']['tmpfile'])) {
echo "\n";
self::bye("Option tmpfile is missing, wrong uage of this funtion!");
}
- fwrite($o['tmpfile'],$line."\n");
+ fwrite($o['_human']['tmpfile'],$line."\n");
}
public static function out_human_end(&$o) {
$len = $o['_human']['len'];
- fseek($o['tmpfile'], 0);
+ fseek($o['_human']['tmpfile'], 0);
$sep_line = '';
if (self::p('sep_line') !== '0') {
$header = empty($o['_human']['head']) ? 0 : 1;
$count = 0;
- while (($line = fgets($o['tmpfile'])) !== false) {
+ while (($line = fgets($o['_human']['tmpfile'])) !== false) {
$values = [];
$i = 0;
$count++;
}
- fclose($o['tmpfile']);
+ fclose($o['_human']['tmpfile']);
unset($o['_human']);
if ($header) $count--;
'css',
'js',
'format_html_ua_exp',
+ 'format_cli',
'expires',
] as $k) {
$env = 'DBQ_'.strtoupper($k);
- if (isset($_SERVER[$env])) $this->$k = $_SERVER[$env];
+ if (isset($_SERVER[$env]) and $_SERVER[$env] !="") $this->$k = $_SERVER[$env];
}
// Envs -> params
if ($DBQ_EXPIRES = "") { set $DBQ_EXPIRES ""; }
fastcgi_param DBQ_EXPIRES $DBQ_EXPIRES;
+
+ if ($DBQ_FORMAT_CLI = "") { set $DBQ_FORMAT_CLI ""; }
+ fastcgi_param DBQ_FORMAT_CLI $DBQ_FORMAT_CLI;
}