prepare($sql); try { $sth->execute($params); } catch (PDOexception $e) { $g_error->Add('SQL-Error: '. $e->getMessage()); $g_error->Add($sql); $g_error->Add(print_r($params, true)); } return $newsize; } function file_get_docname($docid, $doctype, $extension) { global $g_doc_typemap; return sprintf('%s-%06d.%s', $g_doc_typemap[$doctype], $docid, $extension); } function dir_get_size($path) { // gets the size of a directory in bytes recursively $total = 0; $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS) ); foreach ($iterator as $file){ $total += $file->getSize(); } return $total; }