From e3842a8b5ee0fa11c73be7bd4f81302cc78dce9f Mon Sep 17 00:00:00 2001 From: Maximilian Kresse <545671+maximiliankresse@users.noreply.github.com> Date: Fri, 20 Nov 2020 12:07:43 +0100 Subject: [PATCH] Replace serialize with json_encode in demo --- examples/demo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/demo.php b/examples/demo.php index 41f6694..17bffe6 100644 --- a/examples/demo.php +++ b/examples/demo.php @@ -43,11 +43,11 @@ // alternativly you can remember you last access token // this is a simple example using the file system. redis or memcache may be a better solution //if (file_exists(__DIR__ . '/token')) { -// $token = unserialize(file_get_contents(__DIR__ . '/token'), ['allowed_classes' => false]); +// $token = json_decode(file_get_contents(__DIR__ . '/token'), true); //} //if (!isset($token, $token['accessToken'], $token['expires']) || $token['expires'] < (time() - 60)) { // $token = $azureModule->createTokenBySharedSecret($tenantId, $appClientId, $appClientSecret); -// file_put_contents(__DIR__ . '/token', serialize($token)); +// file_put_contents(__DIR__ . '/token', json_encode($token, JSON_PRETTY_PRINT)); //} $azureModule->setAccessToken($token['accessToken']);