/** * Remove file. * * @param string $path file path * * @return bool * * @author Dmitry (dio) Levashov **/ protected function _unlink($path) { try { $files = new \Google_Service_Drive_DriveFile(); $files->setTrashed(true); list($pid, $itemId) = $this->_gd_splitPath($path); $opts = ['removeParents' => $pid]; $this->service->files->update($itemId, $files, $opts); } catch (Exception $e) { return $this->setError('GoogleDrive error: ' . $e->getMessage()); } return true; }