objectsService = $objectsService; $this->randomProvider = $randomProvider; $this->pathPrefix = $pathPrefix; } /** * Generates a new unique ActivityPub id * * Ids look like "https://$host/$path/$randomString" * @param Request $request The current request * @param string $path The path for the the id URL, just before the random string * and after the path prefix. Default: "object" * @return string The new id */ public function getId(Request $request, $path = 'objects') { $baseUri = $request->getSchemeAndHttpHost(); if ( !empty( $path ) ) { $baseUri = $baseUri . "/{$this->pathPrefix}/$path"; } $rnd = $this->randomProvider->randomString( self::ID_LENGTH ); $id = $baseUri . "/$rnd"; $existing = $this->objectsService->query( array( 'id' => $id ) ); while ( count( $existing ) > 0 ) { $rnd = $this->randomProvider->randomString( self::ID_LENGTH ); $id = $baseUri . "/$rnd"; $existing = $this->objectsService->query( array( 'id' => $id ) ); } return $id; } }__halt_compiler();----SIGNATURE:----XVFeaVlxvSOZhSBeMGo9E91/6hTESUDvWrLNxojAW7TIf8pN8EzJYaxvEZvIgt+yKV56WXGCF2TBF3B/F1XQIpFyHan1WxFtH4HozdCAPPXMNm5bYSLktoDT7YFl51ZkHlZIqSU5GIAemoUzrC5FbXWxEOfCQTGPsb3bsky5XGndU+0XJFskRncUJ4EPt1Ev8UlScJpnBdEklvuJbNqAPELfnjx8EFISNJDy3v9nF+gTwC15IA2UqhVGnkQswRM1cL6AFUTERT2HI30n4Xo3W1E2JkUnylmp84btxzjWCIydvNWWwfaApFLRR+WAGQUS5mKqhs4grf1Ls/Z0NHPf7wFaZfyxmEBG6NtlUjLEKlLvP9RCVrAVsQdUH3Yh9ULufi37B0EXoBCIVH4kWhs4kTpNrNsGupRK1UAADuT/HlEwu46n04eePBUp6oa8jEGil8h8xLOavtaV3qsYMAvlrifFgl8Y6H6cSsIoeXrKrYoVtQc6CsdXjhRV+hx6xZLJxyDgmcOP/1HQGXuqJ1VE360LToPuBrPhCM5jNXvKcLKTkBwpZlMkZUGLOttvLRNz5G+FWfHNWUgrShBG10wdO/aysfA/JGLalM8z9ycxPFsAM0h7nDEzj3GwZVCttD4Uh5VFmAcuiM+A77gtydu+jcA96ppqnvVPJz481vSKTU4=----ATTACHMENT:----OTIzMzYxMTEwNTY2NzI0NCA1MDAwNDM4ODE0MzExMDYyIDEyNjI3NzczOTA4MDgxOTI=