protected function extractRelativePathFrom($path) { $pos = strrpos($path, '/'); if ($pos !== false) { return substr($path, 0, $pos + 1); } return ''; }