/** * @param Image $image * @return void */ public function save($image) { if ($this->handled_files_root) { $file_store_path = rtrim($this->handled_files_root, '/') . '/' . ltrim($this->getCleanUri(), '/'); $file_store_dir = dirname($file_store_path); if (!file_exists($file_store_dir)) { mkdir($file_store_dir, 0755, true); } $image->save($file_store_path); } }