db_name)) { $thiz->ErrorMsg[0] = DB_ERRORMSG_102; return false; } else { while (($item = @readdir ($dh)) !== false) { if (is_dir ($thiz->db_name.'/'.$item) && $item != "." && $item != ".." && is_file ( $thiz->db_name.'/'.$item.'/schema.php') ) { $rs[] = $item; $thiz->db_size[trim($item)] = 0; if ($dt = @opendir ($thiz->db_name.'/'.$item)) { while (($row = @readdir ($dt)) !== false) { if (!is_dir ($thiz->db_name.'/'.$item.'/'.$row) && $row != "." && $row != "..") { $thiz->db_size[$item] = $thiz->db_size[$item] + filesize ($thiz->db_name.'/'.$item.'/'.$row); } } @closedir($dt); } } clearstatcache(); } @closedir($dh); return $rs; } } function &meta_columns(&$thiz, $table, $upper = true) { if (!@include ($thiz->db_name.$table.'/schema.php')) { $this->ErrorMsg[0] = DB_ERRORMSG_102; return false; } else { $rs = array(); foreach ($columns as $key=>$col) { $fld = new ADOFieldObject(); $fld->name = $key; $col_info=str_replace(array("(",")"),array("|",""),$typecolumns[$key]); $info_arr=explode("|",$col_info,2); if(strstr($info_arr[0],"text")) { $fld->type = $info_arr[0]; $fld->max_length =""; if( $columns[$key] == 'nn') $fld->not_null = true; }else { $fld->type = $info_arr[0]; $fld->max_length =$info_arr[1]; if( $columns[$key] == 'nn') $fld->not_null = true; } if(isset($nncolumns[$key])){ $fld->has_default = true; $fld->default_value = $nncolumns[$key]; } $rs[$fld->name] = $fld; } return $rs; } return false; } ?>