public function cleanup(UserProfile $prop) { if ($prop->getProperty()->getFieldType() === ProfileProperty::TYPE_FILE) { /*$fileName = str_replace($this->getBaseFileUrl() . '/', '', $prop->getPropertyValue()); if ( is_file($this->getBaseFilePath() . '/' . $fileName) ) { echo 'maybe removing ' . $this->getBaseFilePath() . '/' . $fileName; @unlink($this->getBaseFilePath() . '/' . $fileName); }*/ $fileKey = AbstractUploader::extractKey($prop->getPropertyValue(), $this->awsBucket); if ($fileKey && $this->filesystem->has($fileKey)) { $this->filesystem->delete($fileKey); } } }