X-Git-Url: http://git.dj3c1t.com/index.cgi?a=blobdiff_plain;f=mw%2Fapp%2Fdata%2Fmodules%2Fshare%2Fmw_data_sgbds.php;fp=mw%2Fapp%2Fdata%2Fmodules%2Fshare%2Fmw_data_sgbds.php;h=db908550ee93f69dda491a1e464c8a48b77ceb87;hb=0ada6496e6c552c473a5816734b38896ccdd345b;hp=0000000000000000000000000000000000000000;hpb=c8731e3a31f51a93cfff9fe7206dd6fb007bc733;p=mtweb diff --git a/mw/app/data/modules/share/mw_data_sgbds.php b/mw/app/data/modules/share/mw_data_sgbds.php new file mode 100644 index 0000000..db90855 --- /dev/null +++ b/mw/app/data/modules/share/mw_data_sgbds.php @@ -0,0 +1,37 @@ +env(); + $sgbds = array(); + $impls_dir = $env->app_file("data/impl"); + if(!file_exists($impls_dir) || !is_dir($impls_dir)){ + return false; + } + if($dh = opendir($impls_dir)){ + $OK = true; + while($OK && ($impl_file = readdir($dh)) !== false){ + if(substr($impl_file, 0 ,1) !== "." && substr($impl_file, -4) == ".php"){ + require_once $impls_dir."/".$impl_file; + if(class_exists($class_name = substr($impl_file, 0, -4))){ + if( + method_exists($class_name, "sgbd_name") + && method_exists($class_name, "extention_ok") + ){ + $impl = new $class_name(); + if($impl->extention_ok($env)) $sgbds[$class_name] = $impl; + } + } + } + } + } + else{ + return false; + } + return $sgbds; + } + + } + +?> \ No newline at end of file