Skip to content

Instantly share code, notes, and snippets.

@colindecarlo
Created May 23, 2012 02:44
Show Gist options
  • Save colindecarlo/2772976 to your computer and use it in GitHub Desktop.
Save colindecarlo/2772976 to your computer and use it in GitHub Desktop.
protected _persist method in Persister subclass File
<?php
// interesting bits
protected function _persist()
{
$this->_location = tempnam(sys_get_temp_dir(), 'UL-');
if (!$this->_moveUploadedFile()) {
unlink($this->_location);
$this->_location = null;
throw new \Exception('error moving uploaded file');
}
}
// interesting bits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment