#####################################################################
# m h dom mon dow user command
#
-*/15 09-23 * * * root nb-update >/var/log/nb.log 2>&1 | true
-0 00 * * * root nb-update -cleanup >/var/log/nb.log 2>&1 | true
-0 01-08 * * * root nb-update >/var/log/nb.log 2>&1 | true
+*/15 09-23 * * * root . /etc/profile && nb-update >/var/log/nb.log 2>&1 | true
+0 00 * * * root . /etc/profile && nb-update -cleanup >/var/log/nb.log 2>&1 | true
+0 01-08 * * * root . /etc/profile && nb-update >/var/log/nb.log 2>&1 | true
+
+25 5 * * * root which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT/etc/cron.daily" ] && cd / && run-parts --report $NB_ROOT/etc/cron.daily
+47 5 * * 7 root which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT/etc/cron.weekly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.weekly
+52 5 1 * * root which run-parts &> /dev/null && . /etc/profile && [ -d "$NB_ROOT/etc/cron.monthly" ] && cd / && run-parts --report $NB_ROOT/etc/cron.monthly
public $title = 'Dbq';
public $sep_title = ' / ';
- public $formats = [ 'html','div','csv','xml','json','yaml','sh','sql','php' ];
+ public $formats = [ 'html','div.html','csv','xml','json','yaml','sh','sql','php' ];
public $format_cli = 'csv';
public $format_html = 'table';
public $format_html_ua_exp = '/^\S+\s+.Windows|iPhone|Android|Macintosh|Linux/';
#debug($this->base);
$this->page->begin();
+ } else {
+ #$this->db->is_html = false;
} # if (empty($this->_nopage)) {
#die($obj);
$this->uri = $path;
$this->uri_params = explode($this->expode_args,$args);
- if (preg_match('/\.(\w+(\.html)?)$/',$path,$m)) {
- $values[] = $m[1];
+ // We accept sub extention, that will determine if we wanr to print the full page
+ if (preg_match('/\.((\w+)(\.html)?)$/',$path,$m)) {
$path = substr($path,0,strlen($path)-strlen($m[1])-1);
+ $values[] = $m[2];
+
+ if (isset($m[3])) {
+ $this->ext = 'html';
+ } elseif($m[2] != 'html') {
+ $this->_nopage = true;
+ }
+ #bye([$path,$m[1]]);
+
} else {
$values[] = '';
+
}
$path = trim($path,'/');
public function run_init() {
$this->db();
+ if (!empty($this->formats)) $this->db->formats = $this->formats;
+ if (!empty($this->limits)) $this->db->limits = $this->limits;
// Format first !
if ($this->params['format']) {
}
- // Post defaults values
- if (empty($this->ext)) $this->ext = $format;
-
- if (!empty($this->formats)) $this->db->formats = $this->formats;
- if (!empty($this->limits)) $this->db->limits = $this->limits;
-
// Then content type
if (empty($content_type)) $content_type = Mime::get($format==$this->format_cli ? 'txt' : $format);
if (empty($content_type) and $this->db->out->is_html($format)) $content_type = 'text/html';
// Affect values to objects
if ($format == 'html') $format = $this->format_html;
- #bye($this->params['format']);
-#bye(preg_match('/^(.*?)\.html$/',$this->params['format']));
- // Set _nopage
- if (preg_match('/^(.*?)\.html$/',$this->format_html)) if (preg_match('/^(.*?)\.html$/',$format,$m)) {
- $format = $m[1];
- } else {
- $this->_nopage = true;
- }
$this->format($format);
+
+ // Post defaults values
+ if (empty($this->ext)) $this->ext = $format;
$this->method_post_accept_decode();
$this->is_html = strpos($content_type,'html') ? true : false;
$this->db->is_html = $this->is_html;