]> git.nbdom.net Git - nb.git/commitdiff
Bed
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 12 Aug 2016 00:14:11 +0000 (02:14 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 12 Aug 2016 00:14:11 +0000 (02:14 +0200)
lib/php/db/shell.php [new file with mode: 0755]

diff --git a/lib/php/db/shell.php b/lib/php/db/shell.php
new file mode 100755 (executable)
index 0000000..4e07e89
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/env php
+<?php
+define('DB_NO_ACTION',true);
+#require_once(dirname(__FILE__).'/index.php');
+require_once(dirname(__FILE__).'/../db.php');
+Db::pinit();
+# Set format from client Accept if != html
+#bye(out::client_type());
+Db::pdef('format',out::client_type());
+
+$Conf = Db::conf_dbs(array( Db::ROOT_DIR.'/etc/dbs.yaml',Db::ROOT_DIR.'/etc/dbs.php','/etc/dbs.yaml' ));
+$Db = null;
+$Table = null;
+
+while($line = fgets(STDIN)){
+
+  # Set params
+  #if (preg_match('/^\s*([^=]+)\s*=\s*(.*?)\s*$/',$line,$args)) {
+    #echo "IGNORE: $line";
+  while ($line and preg_match('/^\s*([^=]+)\s*=\s*(.*?)\s*$/',$line,$args)) {
+
+    array_shift($args);
+    #var_dump($args);
+    $Db->pset($args[0],$args[1]);
+    $line = mb_substr($line,mb_strlen($line)-1);
+
+  }
+  Db::pinit();
+  die(Db::p('table'));
+  if (!Db::p('action')) continue;
+  var_dump(Db::p());
+  #echo ">>".$Db->p('action')."\n";
+
+  $r = $Db->action($Db->p('action'),$Table);
+  #foreach ($args
+
+
+}
+?>