}
docker_build() {
- local docker_name=$(_docker_name "$1") || return; shift
- [ -e Dockerfile ] || exec echo "Dockerfile missing in $(pwd)" 1>&2
+
+ local docker_name=$(_docker_name "$1") || return ; shift
+ [ ! -e Dockerfile ] && echo "Dockerfile missing in $(pwd)" 1>&2 && return
if [ -n "$(docker images -q $docker_name 2>/dev/null)" ]; then
echo "$docker_name already build."
docker_run() {
local docker_name=$(_docker_name "$1") || return
- [ -n "$1" -a -d "$1" ] && cd "$1"
+ #[ -n "$1" -a -d "$1" ] && cd "$1"
shift
- perl -ne '/^\s*\#\s*DOCKER_RUN\s*(.*?)$/ and $RUN=1 and system "$1"; END{exit ($RUN ? 0 : 1)}' Dockerfile && return
+ [ -e Dockerfile ] && perl -ne '/^\s*\#\s*DOCKER_RUN\s*(.*?)$/ and $RUN=1 and system "$1"; END{exit ($RUN ? 0 : 1)}' Dockerfile && return
docker run --rm -it --name $docker_name --hostname $docker_name $@ $docker_name
}
require_once(realpath(dirname(__FILE__).'/../config.php'));
require_once(realpath(dirname(__FILE__).'/../db.php'));
-$DB_CONFS = Db::conf_load([
+$DB_CONFS = Db::conf_load(
+glob('/etc/dbq/*.yaml')+
+glob('/etc/dbq/*.php')+
+[
Db::ROOT_DIR.'/etc/dbs.yaml',
Db::ROOT_DIR.'/etc/dbs.php',
Db::ROOT_DIR.'/etc/dbq.yaml',
Db::ROOT_DIR.'/etc/dbq.php',
+
'/etc/dbs.yaml',
'/etc/dbq.yaml',
public static function ls_dir($path,$exp='',$recurse=false) {
- $ls = array();
+ $ls = [];
$rep = opendir($path);
- #die(">>>".$exp);
while($file = readdir($rep)) {
- if ($file == '.' or $file == '..') continue;
+ if ($file === '' or $file == '.' or $file == '..') continue;
+#die(">>>$file | $exp | $path");
- if (!$exp or preg_match('#'.$exp.'#',$file)) {
+ if (empty($exp) or preg_match('#'.$exp.'#',$file)) {
$ls[] = $file;
#$ls[] = "$path/$file";
}