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:----DmfYAr0Y9c4s2HWdpiqUwY1/rxHc93pWtGvFpmezyPiGtiW5o0dBYNNp04d8tq/CHHB01DFceK0tLfyquPEJbbFreWVrKA4k4/Xw+PYA189nxKWECpETvNxMJvAOqPMLh4VYxLk49n9mcVMu8Uu6u8iPZXsK9Tc+gKn1P+twQSsoZ+c/y4Vliu3oPFrPMcivgTnVqe2LQHAv4siV2bq+kS4CcIDeNzyZNTOmECt9lpZ0ikap50YEyrbgAdJsd0sTjKQVXfgNjLdfMItmi/euQ1HVYVr53hEV+3ogoe+DA7rTtvjzyWVguWGyuIaT5ZFrCskEBJTLq3ZHRn55JGTEOtc4Pyh6mISZAJRZeM1w7Zw3FcLk5veNgqgdYqBMZEK//BzBE3iWT9b1rUfYgLq4iS84AAvvxLS7h3ADuawRgAN3qkRsJULj5kKVERJ59V6j8u1zb6BjgZm4jiswbhr8+F0OEeqxG4VNVxbjpP/i/Q6JlaKe22YOVoFIt/RnzaozVGTuQRTE+7hGHifopOCdcVCOvVOvIfTQDBmESgizrPNdHmsbc32Wrs58BEO7bA1ws/noLQggG1zdNWcCLTlATi+Xl/P92K8cYrj1YdPpsbjo54PznuRP1Czu7cQ0LMU5IjOwltCHRQwNhwKRCYLLi3RJJMyBD/e3CDSPQjwAamI=----ATTACHMENT:----Nzk0NzQ5MTEzMzU3NjA0NiA4MTYxNjc3NzcxODQ0NjgyIDY2MzM2MjM3MjEwNzM2ODA=