summaryrefslogtreecommitdiffstats
path: root/app/class/agent.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-09-19 15:30:44 -0400
committerMalf Furious <m@lfurio.us>2018-09-19 15:30:44 -0400
commit77cbdc84d952643163d7086f79a633e5837be76d (patch)
treebfca192d611740474c2674836b3e6ea8cf4367c0 /app/class/agent.class.php
parentac291fbe6db4a099bc8281e31ace13dad0a42d79 (diff)
downloadscrott-77cbdc84d952643163d7086f79a633e5837be76d.tar.gz
scrott-77cbdc84d952643163d7086f79a633e5837be76d.zip
globals: Add function saveIfFile()
This is an alternative function to globals' saveFile(), which allows model code to just pass in the name of the expected uploaded file, rather than requiring them to look up the file themselves. This is in line with my preference to encapsulate PHP superglobals access away from most of the codebase. Note that even if the user opts not to upload optional files, the associated file <input> field will still be present in $_FILES, with a special error code set (meaning 'no file uploaded') which setFile() ignores. It is only in the case of a malformed form submission that $_FILES will be missing the requested file field, prompting Scrott to throw an exception.
Diffstat (limited to 'app/class/agent.class.php')
0 files changed, 0 insertions, 0 deletions