From 1c1c04dbad893700ab34057a61e74659691e5665 Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 21 Mar 2014 14:43:06 +0100 Subject: [PATCH] filemask for img corrected, sql utility --- dbd/sql/pg/util_copy_api_table_by_groupa.sql | 13 +++++++++++++ img/img.php | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 dbd/sql/pg/util_copy_api_table_by_groupa.sql diff --git a/dbd/sql/pg/util_copy_api_table_by_groupa.sql b/dbd/sql/pg/util_copy_api_table_by_groupa.sql new file mode 100644 index 0000000..3f6ba41 --- /dev/null +++ b/dbd/sql/pg/util_copy_api_table_by_groupa.sql @@ -0,0 +1,13 @@ +-- delete old entries of group +DELETE FROM system.api where "group" = 101; +-- get data from group 0 and write it in your group +INSERT INTO system.api ( "ID", "group","type","parentID","parentValue","name","verify" ) + SELECT "ID", + '101' as "group", -- target group + "type", + "parentID", + "parentValue", + "name", + "verify" + FROM system.api + WHERE "group" = 0; -- pattern group \ No newline at end of file diff --git a/img/img.php b/img/img.php index 0cf0be6..f55a8bd 100644 --- a/img/img.php +++ b/img/img.php @@ -56,7 +56,7 @@ class img { private static function getFolder($folder, $mask) { $files = array(); - foreach (glob($folder . $mask) as $file) { + foreach (glob($folder . $mask,GLOB_BRACE) as $file) { $files[] = basename($file); } return $files;