|
@@ 135-157 (lines=23) @@
|
| 132 |
|
* |
| 133 |
|
* @return Response |
| 134 |
|
*/ |
| 135 |
|
public function whatYouWantAction(Request $request) |
| 136 |
|
{ |
| 137 |
|
// app already installed |
| 138 |
|
if ($this->container->getParameter('anime_db.catalog.installed')) { |
| 139 |
|
return $this->redirect($this->generateUrl('home')); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
$response = $this->getCacheTimeKeeper()->getResponse(); |
| 143 |
|
// response was not modified for this request |
| 144 |
|
if ($response->isNotModified($request)) { |
| 145 |
|
return $response; |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
if ($request->isMethod('POST')) { |
| 149 |
|
$storage = $this->getRepository()->getLast(); |
| 150 |
|
$this->get('event_dispatcher')->dispatch(StoreEvents::INSTALL_SAMPLES, new SamplesInstall($storage)); |
| 151 |
|
return $this->redirect($this->generateUrl('install_end_skip', ['from' => 'install_sample'])); |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
return $this->render('AnimeDbCatalogBundle:Install:what_you_want.html.twig', [ |
| 155 |
|
'guide' => $this->get('anime_db.api.client')->getSiteUrl(self::GUIDE_LINK_SCAN) |
| 156 |
|
], $response); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
/** |
| 160 |
|
* Scan storage (Stap #4) |
|
@@ 201-223 (lines=23) @@
|
| 198 |
|
* |
| 199 |
|
* @return Response |
| 200 |
|
*/ |
| 201 |
|
public function endAction(Request $request, $from = '') |
| 202 |
|
{ |
| 203 |
|
// app already installed |
| 204 |
|
if ($this->container->getParameter('anime_db.catalog.installed')) { |
| 205 |
|
return $this->redirect($this->generateUrl('home')); |
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
$response = $this->getCacheTimeKeeper()->getResponse(); |
| 209 |
|
// response was not modified for this request |
| 210 |
|
if ($response->isNotModified($request)) { |
| 211 |
|
return $response; |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
if ($request->isMethod('POST')) { |
| 215 |
|
$this->get('event_dispatcher')->dispatch(StoreEvents::INSTALL_APP, new AppInstall()); |
| 216 |
|
return $this->redirect($this->generateUrl('home')); |
| 217 |
|
} |
| 218 |
|
|
| 219 |
|
return $this->render('AnimeDbCatalogBundle:Install:end.html.twig', [ |
| 220 |
|
'guide' => $this->get('anime_db.api.client')->getSiteUrl(self::GUIDE_LINK_START), |
| 221 |
|
'from' => $from |
| 222 |
|
], $response); |
| 223 |
|
} |
| 224 |
|
|
| 225 |
|
/** |
| 226 |
|
* @return StorageRepository |