use sgoendoer\Sonic\examples\PersonAPIExample; use sgoendoer\Sonic\examples\LikeAPIExample; try { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // setting Configuration //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // setting all configuration values to defaults Configuration::setVerbose(0); Configuration::setCurlVerbose(0); Configuration::setLogfile('sonic.log'); Configuration::setApiPath('/sonic/'); Configuration::setTimezone('Europe/Berlin'); Configuration::setPrimaryGSLSNode('130.149.22.135:4002'); Configuration::setSecondaryGSLSNode('130.149.22.133:4002'); Configuration::setRequestTimeout(10); Configuration::setGSLSTimeout(4); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // importing SocialRecord objects to work with //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // load SocialRecords from files to instatiaze the Sonic framework $srp = SocialRecordManager::importSocialRecord(file_get_contents(__DIR__ . '/data/SRPlatform.json')); $platformSocialRecord = $srp['socialRecord']; $platformAccountKeyPair = $srp['accountKeyPair']; $platformPersonalKeyPair = $srp['personalKeyPair']; $sra = SocialRecordManager::importSocialRecord(file_get_contents(__DIR__ . '/data/SRAlice.json')); $userSocialRecord = $sra['socialRecord']; $userAccountKeyPair = $sra['accountKeyPair']; $userPersonalKeyPair = $sra['personalKeyPair']; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // initializing Sonic SDK ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} if (count($requestURL) >= 5) { $subresourceID = $requestURL[4]; } if (count($requestURL) >= 6) { $subsubresource = $requestURL[5]; } } try { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // setting Configuration //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Configuration::setLogfile('sonic.log'); Configuration::setApiPath('/sonic-api-endpoint/'); Configuration::setTimezone('Europe/Berlin'); Configuration::setPrimaryGSLSNode('130.149.22.135:4002'); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // importing SocialRecord objects to work with //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // load SocialRecords from files to instatiaze the Sonic framework $srp = SocialRecordManager::importSocialRecord(file_get_contents(__DIR__ . '/data/SRPlatform.json')); $platformSocialRecord = $srp['socialRecord']; $platformAccountKeyPair = $srp['accountKeyPair']; $platformPersonalKeyPair = $srp['personalKeyPair']; $sra = SocialRecordManager::importSocialRecord(file_get_contents(__DIR__ . '/data/SRAlice.json')); $userSocialRecord = $sra['socialRecord']; $userAccountKeyPair = $sra['accountKeyPair']; $userPersonalKeyPair = $sra['personalKeyPair']; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // initializing Sonic SDK ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////