function safe_attachment_copy($source, $id, $ext) { $loc = $GLOBALS['FILE_STORE'] . $id . '.atch'; if (!$ext && !move_uploaded_file($source, $loc)) { std_out('unable to move uploaded file', 'ERR'); } else { if ($ext && !copy($source, $loc)) { std_out('unable to handle file attachment', 'ERR'); } } @unlink($source); @chmod($loc, $GLOBALS['FUD_OPT_2'] & 8388608 ? 0600 : 0666); return $loc; }
private function _processResult($result, $mapFn = NULL) { switch (gettype($result)) { case 'array': std_out('outputting ' . count($result) . ' values'); array_map($mapFn, $result); break; default: std_out('output:' . $result); break; } }