|
33 | 33 | )); |
34 | 34 |
|
35 | 35 | // Intialize a cache, store it in the app container |
36 | | -$app->container->singleton('cache', function() { |
| 36 | +$app->container->singleton('cache', function () { |
37 | 37 | return new Cache; |
38 | 38 | }); |
39 | 39 |
|
|
45 | 45 | $app->apiKey = getenv('API_KEY'); |
46 | 46 |
|
47 | 47 | // If a sessionId has already been created, retrieve it from the cache |
48 | | -$sessionId = $app->cache->getOrCreate('sessionId', array(), function() use ($app) { |
| 48 | +$sessionId = $app->cache->getOrCreate('sessionId', array(), function () use ($app) { |
49 | 49 | // If the sessionId hasn't been created, create it now and store it |
50 | 50 | $session = $app->opentok->createSession(array( |
51 | 51 | 'mediaMode' => MediaMode::ROUTED |
|
94 | 94 |
|
95 | 95 | $archives = $app->opentok->listArchives($offset, 5); |
96 | 96 |
|
97 | | - $toArray = function($archive) { |
| 97 | + $toArray = function ($archive) { |
98 | 98 | return $archive->toArray(); |
99 | 99 | }; |
100 | 100 |
|
|
123 | 123 | echo $archive->toJson(); |
124 | 124 | }); |
125 | 125 |
|
126 | | -$app->get('/stop/:archiveId', function($archiveId) use ($app) { |
| 126 | +$app->get('/stop/:archiveId', function ($archiveId) use ($app) { |
127 | 127 | $archive = $app->opentok->stopArchive($archiveId); |
128 | 128 | $app->response->headers->set('Content-Type', 'application/json'); |
129 | 129 | echo $archive->toJson(); |
130 | 130 | }); |
131 | 131 |
|
132 | | -$app->get('/delete/:archiveId', function($archiveId) use ($app) { |
| 132 | +$app->get('/delete/:archiveId', function ($archiveId) use ($app) { |
133 | 133 | $app->opentok->deleteArchive($archiveId); |
134 | 134 | $app->redirect('/history'); |
135 | 135 | }); |
|
0 commit comments