Db::pinit();
-if(defined('DB_NO_INIT') and DB_NO_INIT) return true;
-Db::init([Db::ROOT_DIR.'/etc/dbs.yaml',Db::ROOT_DIR.'/etc/dbs.php','/etc/dbs.yaml']);
+$DB_CONFS = Db::conf_load([ Db::ROOT_DIR.'/etc/dbs.yaml',Db::ROOT_DIR.'/etc/dbs.php','/etc/dbs.yaml' ]);
?>
*
* lib/php/db/index.php
*/
-require_once(realpath(dirname(__FILE__).'/config.php'));
+require_once(realpath(dirname(__FILE__).'/init.php'));
if(defined('DB_NO_ACTION') and DB_NO_ACTION) return true;
require_once(realpath(dirname(__FILE__).'/../config.php'));
require_once(realpath(dirname(__FILE__).'/../db.php'));
-define('DB_NO_INIT',true);
require_once(realpath(dirname(__FILE__).'/config.php'));
Db::init($DB_CONFS);
<?php
-require_once(dirname(__FILE__).'/../config.php');
+require_once(dirname(__FILE__).'/init.php');
require_once(dirname(__FILE__).'/../page.php');
-
-require_once(dirname(__FILE__).'/../db/config.php');
$Page = new Page([
'title' => ($Db->title ? $Db->title : Db::prettyText($Db->name)),
'content_type' => Page::content_type_and_set_format(),
#!/usr/bin/env php
<?php
-require_once(dirname(__FILE__).'/../config.php');
-require_once(dirname(__FILE__).'/../db.php');
+require_once(dirname(__FILE__).'/config.php');
#
# Default params
#bye(out::client_type());
Db::pdef('format','human');
-#
-# Confs
-#
-$Confs = Db::conf_load([ Db::ROOT_DIR.'/etc/dbs.yaml',Db::ROOT_DIR.'/etc/dbs.php','/etc/dbs.yaml' ]);
-
#
# Parse stdin
#
'table',
'format',
];
-#bye($Confs['ui']);
+#bye($DB_CONFS['ui']);
while($line = fgets(STDIN)){
$line = trim($line);
}
function db_shell_action($k,$v) {
- global $Confs, $Db, $Table;
+ global $DB_CONFS, $Db, $Table;
Db::pset($k,$v);
Db::pinit();
break;
case 'db':
-#bye($Confs[$v]);
- $Db = new Db($Confs[$v]+['conf'=>$Confs]);
+#bye($DB_CONFS[$v]);
+ $Db = new Db($DB_CONFS[$v]+['conf'=>$DB_CONFS]);
$Db->connect();
break;