]> git.nbdom.net Git - nb.git/commitdiff
rename rent.db, fix hl bug
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 29 Aug 2016 18:21:17 +0000 (19:21 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 29 Aug 2016 18:21:17 +0000 (19:21 +0100)
etc/dbs/nb.php
etc/dbs/rent.php
etc/profile.d/functions
lib/php/db.php

index 1d07ebf52d3df673863e74ffd1e183d8bcff2e39..a6b29b00cd7775db1cc9e0f26a974acb4f83ce76 100644 (file)
@@ -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',
+);
 ?>
index 0f9fac11eeeb58e84b679a881ae447cfdc7b628f..519cb42388c18d75026f6534cc07aeb8d2faaae5 100644 (file)
@@ -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) {
index 83019078415ac76c137a6ff76d3025e21b315ee1..97be3979df69529b679b365cd3149d3a23fb6881 100644 (file)
@@ -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() {
index 4e666c7815ba31b4e4d542bee842ca33ff78884f..e3d51d02988565e06029d36e844922f6390397c9 100644 (file)
@@ -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 {