From 898fd14c59cd8fffdfb967ecfa4eeee9826abff9 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 29 Aug 2016 19:21:17 +0100 Subject: [PATCH] rename rent.db, fix hl bug --- etc/dbs/nb.php | 6 ++++++ etc/dbs/rent.php | 10 ---------- etc/profile.d/functions | 2 +- lib/php/db.php | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/etc/dbs/nb.php b/etc/dbs/nb.php index 1d07ebf5..a6b29b00 100644 --- a/etc/dbs/nb.php +++ b/etc/dbs/nb.php @@ -6,4 +6,10 @@ $CONF['nb'] = array( 'order' => '6', '_import' => array('_rent','_nico'), ); + +$CONF['nb-sqlite'] = array ( + 'order' => 5, + 'pdo' => 'sqlite:/opt/rent/nb.db', + '_import' => '_rent', +); ?> diff --git a/etc/dbs/rent.php b/etc/dbs/rent.php index 0f9fac11..519cb423 100644 --- a/etc/dbs/rent.php +++ b/etc/dbs/rent.php @@ -62,16 +62,6 @@ $CONF['_rent'] = array( ), ); -$CONF['rent-sqlite'] = array ( - 'order' => 5, - 'pdo' => 'sqlite:/opt/rent/rent.db', - '_import' => '_rent', - 'title' => 'DEV '.$CONF['_rent']['title'] -); - -0 && bye([ - fileowner(!empty($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : __FILE__), -]); return 1; function untilde($path) { diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 83019078..97be3979 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -182,7 +182,7 @@ json2perl() { ################################################################################# hl(){ #cat | grep --color=always -E "(^|($@))" - perl -MTerm::ANSIColor -pe 's/('$@')/color("red").$1.color("reset")/ge' + perl -MTerm::ANSIColor -pe '$e=qq|'$@'|;$e=~s,/,\\/,g; s/($e)/color("red").$1.color("reset")/ge' } ls_tree() { diff --git a/lib/php/db.php b/lib/php/db.php index 4e666c78..e3d51d02 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -174,7 +174,7 @@ class Db extends nb { # Connect if ($this->type('use_path') and !is_readable($this->host)) { - $this->bye("Can't read database file `".$this->host."` type=`".self::$type."`",false); + $this->bye("Can't read database path `".$this->host."` type=`".self::$type."`",false); } try { -- 2.47.3