Skip to content

Instantly share code, notes, and snippets.

@kovagoz
Last active December 29, 2015 21:49
Show Gist options
  • Save kovagoz/7733038 to your computer and use it in GitHub Desktop.
Save kovagoz/7733038 to your computer and use it in GitHub Desktop.
Brainstorm
class File
__construct($filename)
$this->workingCopy = new WorkingCopy($filename)
hasWorkingCopy()
return $this->workingCopy && $this->workingCopy->exists()
getWorkingCopy()
if (!$this->hasWorkingCopy())
$this->workingCopy = new WorkingCopy(Storage::download($this->id))
return $this->workingCopy
$image = new Image($parentImage)
$image->grab(200, 200)
$image->save()
$image = Image::mutate($parent_id)
$image->grab(200, 200);
$image->save()
class Image
__construct($image)
$this->workingCopy = $image->download()
class ImageRepo
mutate($id)
return new Image($this->find($id))
Queue::wait($jobs[], $callback) // gearman sync jobs
wait()
if (!$driver instanceof SyncQueue)
throw new Exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment