@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $em->getConfiguration()->setSQLLogger(null); |
236 | 236 | |
237 | 237 | $response = new StreamedResponse(); |
238 | - $response->setCallback(function () use ($app, $request) { |
|
238 | + $response->setCallback(function() use ($app, $request) { |
|
239 | 239 | |
240 | 240 | // CSV種別を元に初期化. |
241 | 241 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_CUSTOMER); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | // データ行の出力. |
251 | 251 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
252 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
252 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
253 | 253 | |
254 | 254 | $Csvs = $csvService->getCsvs(); |
255 | 255 | |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | }); |
285 | 285 | |
286 | 286 | $now = new \DateTime(); |
287 | - $filename = 'customer_' . $now->format('YmdHis') . '.csv'; |
|
287 | + $filename = 'customer_'.$now->format('YmdHis').'.csv'; |
|
288 | 288 | $response->headers->set('Content-Type', 'application/octet-stream'); |
289 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
289 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
290 | 290 | |
291 | 291 | $response->send(); |
292 | 292 |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $em->getConfiguration()->setSQLLogger(null); |
241 | 241 | |
242 | 242 | $response = new StreamedResponse(); |
243 | - $response->setCallback(function () use ($app, $request) { |
|
243 | + $response->setCallback(function() use ($app, $request) { |
|
244 | 244 | |
245 | 245 | // CSV種別を元に初期化. |
246 | 246 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_ORDER); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // データ行の出力. |
256 | 256 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
257 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
257 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
258 | 258 | |
259 | 259 | $Csvs = $csvService->getCsvs(); |
260 | 260 | |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | }); |
296 | 296 | |
297 | 297 | $now = new \DateTime(); |
298 | - $filename = 'order_' . $now->format('YmdHis') . '.csv'; |
|
298 | + $filename = 'order_'.$now->format('YmdHis').'.csv'; |
|
299 | 299 | $response->headers->set('Content-Type', 'application/octet-stream'); |
300 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
300 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
301 | 301 | $response->send(); |
302 | 302 | |
303 | 303 | log_info('受注CSV出力ファイル名', array($filename)); |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $em->getConfiguration()->setSQLLogger(null); |
323 | 323 | |
324 | 324 | $response = new StreamedResponse(); |
325 | - $response->setCallback(function () use ($app, $request) { |
|
325 | + $response->setCallback(function() use ($app, $request) { |
|
326 | 326 | |
327 | 327 | // CSV種別を元に初期化. |
328 | 328 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_SHIPPING); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | // データ行の出力. |
338 | 338 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
339 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
339 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
340 | 340 | |
341 | 341 | $Csvs = $csvService->getCsvs(); |
342 | 342 | |
@@ -386,9 +386,9 @@ discard block |
||
386 | 386 | }); |
387 | 387 | |
388 | 388 | $now = new \DateTime(); |
389 | - $filename = 'shipping_' . $now->format('YmdHis') . '.csv'; |
|
389 | + $filename = 'shipping_'.$now->format('YmdHis').'.csv'; |
|
390 | 390 | $response->headers->set('Content-Type', 'application/octet-stream'); |
391 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
391 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
392 | 392 | $response->send(); |
393 | 393 | |
394 | 394 | log_info('配送CSV出力ファイル名', array($filename)); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $em->getConfiguration()->setSQLLogger(null); |
206 | 206 | |
207 | 207 | $response = new StreamedResponse(); |
208 | - $response->setCallback(function () use ($app, $request) { |
|
208 | + $response->setCallback(function() use ($app, $request) { |
|
209 | 209 | |
210 | 210 | // CSV種別を元に初期化. |
211 | 211 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_CATEGORY); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | // データ行の出力. |
221 | 221 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
222 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) use ($app, $request) { |
|
222 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) use ($app, $request) { |
|
223 | 223 | |
224 | 224 | $Csvs = $csvService->getCsvs(); |
225 | 225 | |
@@ -252,9 +252,9 @@ discard block |
||
252 | 252 | }); |
253 | 253 | |
254 | 254 | $now = new \DateTime(); |
255 | - $filename = 'category_' . $now->format('YmdHis') . '.csv'; |
|
255 | + $filename = 'category_'.$now->format('YmdHis').'.csv'; |
|
256 | 256 | $response->headers->set('Content-Type', 'application/octet-stream'); |
257 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
257 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
258 | 258 | $response->send(); |
259 | 259 | |
260 | 260 | log_info('カテゴリCSV出力ファイル名', array($filename)); |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | $qb |
154 | 154 | ->andWhere('c.id = :customer_id OR CONCAT(c.name01, c.name02) LIKE :name OR CONCAT(c.kana01, c.kana02) LIKE :kana OR c.email LIKE :email') |
155 | 155 | ->setParameter('customer_id', $id) |
156 | - ->setParameter('name', '%' . $clean_key_multi . '%') |
|
157 | - ->setParameter('kana', '%' . $clean_key_multi . '%') |
|
158 | - ->setParameter('email', '%' . $clean_key_multi . '%'); |
|
156 | + ->setParameter('name', '%'.$clean_key_multi.'%') |
|
157 | + ->setParameter('kana', '%'.$clean_key_multi.'%') |
|
158 | + ->setParameter('email', '%'.$clean_key_multi.'%'); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | // Pref |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
206 | 206 | $qb |
207 | 207 | ->andWhere('CONCAT(c.tel01, c.tel02, c.tel03) LIKE :tel') |
208 | - ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
208 | + ->setParameter('tel', '%'.$searchData['tel'].'%'); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | // buy_total |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | ->leftJoin('c.Orders', 'o') |
300 | 300 | ->leftJoin('o.OrderDetails', 'od') |
301 | 301 | ->andWhere('od.product_name LIKE :buy_product_name OR od.product_code LIKE :buy_product_name') |
302 | - ->setParameter('buy_product_name', '%' . $searchData['buy_product_code'] . '%'); |
|
302 | + ->setParameter('buy_product_name', '%'.$searchData['buy_product_code'].'%'); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | // Order By |
@@ -164,7 +164,7 @@ |
||
164 | 164 | $cmf->setEntityManager($em); |
165 | 165 | $metadatas = $cmf->getAllMetadata(); |
166 | 166 | |
167 | - $filters = array_map(function ($value) { |
|
167 | + $filters = array_map(function($value) { |
|
168 | 168 | return ucfirst(Inflector::camelize(str_replace('plg_', '', $value))); |
169 | 169 | }, $tableList); |
170 | 170 | $metadatas = MetadataFilter::filter($metadatas, $filters); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | private $error = null; |
40 | 40 | private $encode = ''; |
41 | 41 | |
42 | - public function __construct(){ |
|
42 | + public function __construct() { |
|
43 | 43 | $this->encode = self::UTF; |
44 | 44 | if ('\\' === DIRECTORY_SEPARATOR) { |
45 | 45 | $this->encode = self::SJIS; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $arrFileList = $this->getFileList($app, $nowDir); |
85 | 85 | |
86 | 86 | $javascript = $this->getJsArrayList($tree); |
87 | - $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '" . $nowDir . "', 'tree_select_file', 'tree_status', 'move');"; |
|
87 | + $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '".$nowDir."', 'tree_select_file', 'tree_status', 'move');"; |
|
88 | 88 | |
89 | 89 | return $app->render('Content/file.twig', array( |
90 | 90 | 'form' => $form->createView(), |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $nowDir = $this->checkDir($request->get('now_dir'), $topDir) |
142 | 142 | ? $this->normalizePath($request->get('now_dir')) |
143 | 143 | : $topDir; |
144 | - $fs->mkdir($nowDir . '/' . $filename); |
|
144 | + $fs->mkdir($nowDir.'/'.$filename); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | { |
220 | 220 | $str = "arrTree = new Array();\n"; |
221 | 221 | foreach ($tree as $key => $val) { |
222 | - $str .= 'arrTree[' . $key . "] = new Array(" . $key . ", '" . $val['type'] . "', '" . $val['path'] . "', " . $val['rank'] . ','; |
|
222 | + $str .= 'arrTree['.$key."] = new Array(".$key.", '".$val['type']."', '".$val['path']."', ".$val['rank'].','; |
|
223 | 223 | if ($val['open']) { |
224 | 224 | $str .= "true);\n"; |
225 | 225 | } else { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | private function getFileList($app, $nowDir) |
271 | 271 | { |
272 | 272 | $topDir = $app['config']['user_data_realdir']; |
273 | - $filter = function (\SplFileInfo $file) use ($topDir) { |
|
273 | + $filter = function(\SplFileInfo $file) use ($topDir) { |
|
274 | 274 | $acceptPath = realpath($topDir); |
275 | 275 | $targetPath = $file->getRealPath(); |
276 | 276 | return (strpos($targetPath, $acceptPath) === 0); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
101 | 101 | $qb |
102 | 102 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
103 | - ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
103 | + ->setParameter('name', '%'.$searchData['name'].'%'); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | // kana |
107 | 107 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
108 | 108 | $qb |
109 | 109 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
110 | - ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
110 | + ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $qb |
245 | 245 | ->leftJoin('o.OrderDetails', 'od') |
246 | 246 | ->andWhere('od.product_name LIKE :buy_product_name') |
247 | - ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%'); |
|
247 | + ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | // Order By |
@@ -270,13 +270,13 @@ discard block |
||
270 | 270 | ->setParameter('order_id_start', $searchData['order_id_start']); |
271 | 271 | } |
272 | 272 | // multi |
273 | - if (isset( $searchData['multi']) && Str::isNotBlank($searchData['multi'])) { |
|
273 | + if (isset($searchData['multi']) && Str::isNotBlank($searchData['multi'])) { |
|
274 | 274 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
275 | 275 | $qb |
276 | - ->andWhere('o.id = :multi OR o.name01 LIKE :likemulti OR o.name02 LIKE :likemulti OR ' . |
|
276 | + ->andWhere('o.id = :multi OR o.name01 LIKE :likemulti OR o.name02 LIKE :likemulti OR '. |
|
277 | 277 | 'o.kana01 LIKE :likemulti OR o.kana02 LIKE :likemulti OR o.company_name LIKE :likemulti') |
278 | 278 | ->setParameter('multi', $multi) |
279 | - ->setParameter('likemulti', '%' . $searchData['multi'] . '%'); |
|
279 | + ->setParameter('likemulti', '%'.$searchData['multi'].'%'); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | // order_id_end |
@@ -313,28 +313,28 @@ discard block |
||
313 | 313 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
314 | 314 | $qb |
315 | 315 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
316 | - ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
316 | + ->setParameter('name', '%'.$searchData['name'].'%'); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | // kana |
320 | 320 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
321 | 321 | $qb |
322 | 322 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
323 | - ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
323 | + ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | |
327 | 327 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
328 | 328 | $qb |
329 | 329 | ->andWhere('o.email like :email') |
330 | - ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
330 | + ->setParameter('email', '%'.$searchData['email'].'%'); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | // tel |
334 | 334 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
335 | 335 | $qb |
336 | 336 | ->andWhere('CONCAT(o.tel01, o.tel02, o.tel03) LIKE :tel') |
337 | - ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
337 | + ->setParameter('tel', '%'.$searchData['tel'].'%'); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | // sex |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $qb |
447 | 447 | ->leftJoin('o.OrderDetails', 'od') |
448 | 448 | ->andWhere('od.product_name LIKE :buy_product_name') |
449 | - ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%'); |
|
449 | + ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | // Order By |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | $extension = $image->getClientOriginalExtension(); |
206 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
206 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
207 | 207 | $image->move($app['config']['image_temp_realdir'], $filename); |
208 | 208 | $files[] = $filename; |
209 | 209 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $form = $builder->getForm(); |
280 | 280 | |
281 | 281 | if (!$has_class) { |
282 | - $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited()); |
|
282 | + $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited()); |
|
283 | 283 | $form['class']->setData($ProductClass); |
284 | 284 | } |
285 | 285 | |
@@ -365,8 +365,8 @@ discard block |
||
365 | 365 | $Categories = $form->get('Category')->getData(); |
366 | 366 | $categoriesIdList = array(); |
367 | 367 | foreach ($Categories as $Category) { |
368 | - foreach($Category->getPath() as $ParentCategory){ |
|
369 | - if (!isset($categoriesIdList[$ParentCategory->getId()])){ |
|
368 | + foreach ($Category->getPath() as $ParentCategory) { |
|
369 | + if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
370 | 370 | $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count); |
371 | 371 | $app['orm.em']->persist($ProductCategory); |
372 | 372 | $count++; |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $categoriesIdList[$ParentCategory->getId()] = true; |
376 | 376 | } |
377 | 377 | } |
378 | - if (!isset($categoriesIdList[$Category->getId()])){ |
|
378 | + if (!isset($categoriesIdList[$Category->getId()])) { |
|
379 | 379 | $ProductCategory = $this->createProductCategory($Product, $Category, $count); |
380 | 380 | $app['orm.em']->persist($ProductCategory); |
381 | 381 | $count++; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $app['orm.em']->persist($ProductImage); |
398 | 398 | |
399 | 399 | // 移動 |
400 | - $file = new File($app['config']['image_temp_realdir'] . '/' . $add_image); |
|
400 | + $file = new File($app['config']['image_temp_realdir'].'/'.$add_image); |
|
401 | 401 | $file->move($app['config']['image_save_realdir']); |
402 | 402 | } |
403 | 403 | |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | // 削除 |
419 | 419 | $fs = new Filesystem(); |
420 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $delete_image); |
|
420 | + $fs->remove($app['config']['image_save_realdir'].'/'.$delete_image); |
|
421 | 421 | } |
422 | 422 | $app['orm.em']->persist($Product); |
423 | 423 | $app['orm.em']->flush(); |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | foreach ($deleteImages as $deleteImage) { |
578 | 578 | try { |
579 | 579 | $fs = new Filesystem(); |
580 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $deleteImage); |
|
580 | + $fs->remove($app['config']['image_save_realdir'].'/'.$deleteImage); |
|
581 | 581 | } catch (\Exception $e) { |
582 | 582 | // エラーが発生しても無視する |
583 | 583 | } |
@@ -647,10 +647,10 @@ discard block |
||
647 | 647 | |
648 | 648 | // 画像ファイルを新規作成 |
649 | 649 | $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION); |
650 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
650 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
651 | 651 | try { |
652 | 652 | $fs = new Filesystem(); |
653 | - $fs->copy($app['config']['image_save_realdir'] . '/' . $Image->getFileName(), $app['config']['image_save_realdir'] . '/' . $filename); |
|
653 | + $fs->copy($app['config']['image_save_realdir'].'/'.$Image->getFileName(), $app['config']['image_save_realdir'].'/'.$filename); |
|
654 | 654 | } catch (\Exception $e) { |
655 | 655 | // エラーが発生しても無視する |
656 | 656 | } |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | $em->getConfiguration()->setSQLLogger(null); |
726 | 726 | |
727 | 727 | $response = new StreamedResponse(); |
728 | - $response->setCallback(function () use ($app, $request) { |
|
728 | + $response->setCallback(function() use ($app, $request) { |
|
729 | 729 | |
730 | 730 | // CSV種別を元に初期化. |
731 | 731 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_PRODUCT); |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | // データ行の出力. |
766 | 766 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
767 | 767 | |
768 | - $app['eccube.service.csv.export']->exportData(function ($entity, CsvExportService $csvService) use ($app, $request) { |
|
768 | + $app['eccube.service.csv.export']->exportData(function($entity, CsvExportService $csvService) use ($app, $request) { |
|
769 | 769 | $Csvs = $csvService->getCsvs(); |
770 | 770 | |
771 | 771 | /** @var $Product \Eccube\Entity\Product */ |
@@ -808,9 +808,9 @@ discard block |
||
808 | 808 | }); |
809 | 809 | |
810 | 810 | $now = new \DateTime(); |
811 | - $filename = 'product_' . $now->format('YmdHis') . '.csv'; |
|
811 | + $filename = 'product_'.$now->format('YmdHis').'.csv'; |
|
812 | 812 | $response->headers->set('Content-Type', 'application/octet-stream'); |
813 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
813 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
814 | 814 | $response->send(); |
815 | 815 | |
816 | 816 | log_info('商品CSV出力ファイル名', array($filename)); |
@@ -25,8 +25,6 @@ discard block |
||
25 | 25 | |
26 | 26 | use Eccube\Application\ApplicationTrait; |
27 | 27 | use Eccube\Common\Constant; |
28 | -use Eccube\Doctrine\ORM\Mapping\Driver\YamlDriver; |
|
29 | -use Eccube\EventListener\TransactionListener; |
|
30 | 28 | use Eccube\Plugin\ConfigManager as PluginConfigManager; |
31 | 29 | use Eccube\Routing\EccubeRouter; |
32 | 30 | use Eccube\ServiceProvider\MobileDetectServiceProvider; |
@@ -37,13 +35,11 @@ discard block |
||
37 | 35 | use Sergiors\Silex\Provider\TemplatingServiceProvider; |
38 | 36 | use Sergiors\Silex\Routing\ChainUrlGenerator; |
39 | 37 | use Sergiors\Silex\Routing\ChainUrlMatcher; |
40 | -use Symfony\Component\EventDispatcher\EventDispatcher; |
|
41 | 38 | use Symfony\Component\Finder\Finder; |
42 | 39 | use Symfony\Component\HttpFoundation\Request; |
43 | 40 | use Symfony\Component\HttpFoundation\Response; |
44 | 41 | use Symfony\Component\HttpKernel\Event\FilterResponseEvent; |
45 | 42 | use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
46 | -use Symfony\Component\HttpKernel\Event\PostResponseEvent; |
|
47 | 43 | use Symfony\Component\HttpKernel\KernelEvents; |
48 | 44 | use Symfony\Component\Yaml\Yaml; |
49 | 45 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $this->register(new \Silex\Provider\ValidatorServiceProvider()); |
163 | 163 | $this->register(new MobileDetectServiceProvider()); |
164 | 164 | |
165 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
165 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
166 | 166 | if ($this['debug']) { |
167 | 167 | return; |
168 | 168 | } |
@@ -256,14 +256,14 @@ discard block |
||
256 | 256 | return $router; |
257 | 257 | }); |
258 | 258 | |
259 | - $this['eccube.router.origin'] = function ($app) { |
|
259 | + $this['eccube.router.origin'] = function($app) { |
|
260 | 260 | $resource = __DIR__.'/Controller'; |
261 | 261 | $cachePrefix = 'Origin'; |
262 | 262 | |
263 | 263 | return $app['eccube.router']($resource, $cachePrefix); |
264 | 264 | }; |
265 | 265 | |
266 | - $this['eccube.routers.plugin'] = function ($app) { |
|
266 | + $this['eccube.routers.plugin'] = function($app) { |
|
267 | 267 | // TODO 有効なプラグインを対象とする必要がある. |
268 | 268 | $dirs = Finder::create() |
269 | 269 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | return $routers; |
281 | 281 | }; |
282 | 282 | |
283 | - $this['eccube.router.extend'] = function ($app) { |
|
283 | + $this['eccube.router.extend'] = function($app) { |
|
284 | 284 | // TODO ディレクトリ名は暫定 |
285 | 285 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
286 | 286 | $cachePrefix = 'Extend'; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | return $router; |
291 | 291 | }; |
292 | 292 | |
293 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
293 | + $this->extend('request_matcher', function($matcher, $app) { |
|
294 | 294 | $matchers = []; |
295 | 295 | $matchers[] = $app['eccube.router.extend']; |
296 | 296 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | return new ChainUrlMatcher($matchers, $app['request_context']); |
303 | 303 | }); |
304 | 304 | |
305 | - $this->extend('url_generator', function ($generator, $app) { |
|
305 | + $this->extend('url_generator', function($generator, $app) { |
|
306 | 306 | $generators = []; |
307 | 307 | $generators[] = $app['eccube.router.extend']; |
308 | 308 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
334 | 334 | 'locale_fallbacks' => ['ja', 'en'], |
335 | 335 | )); |
336 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
336 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
337 | 337 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
338 | 338 | |
339 | 339 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -380,14 +380,14 @@ discard block |
||
380 | 380 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
381 | 381 | 'twig.form.templates' => array('Form/form_layout.twig'), |
382 | 382 | )); |
383 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
383 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
384 | 384 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
385 | 385 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
386 | 386 | |
387 | 387 | return $twig; |
388 | 388 | }); |
389 | 389 | |
390 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
390 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
391 | 391 | $app['admin'] = false; |
392 | 392 | $app['front'] = false; |
393 | 393 | $pathinfo = rawurldecode($request->getPathInfo()); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | // フロント or 管理画面ごとにtwigの探索パスを切り替える. |
420 | 420 | if (!$app->offsetExists('twig')) { |
421 | 421 | |
422 | - $app->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
422 | + $app->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
423 | 423 | $paths = array(); |
424 | 424 | |
425 | 425 | // 互換性がないのでprofiler とproduction 時のcacheを分離する |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | }, self::EARLY_EVENT); |
467 | 467 | |
468 | 468 | // twigのグローバル変数を定義. |
469 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
469 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
470 | 470 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
471 | 471 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
472 | 472 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
534 | 534 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
535 | 535 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
536 | - \Swift::init(function () { |
|
536 | + \Swift::init(function() { |
|
537 | 537 | \Swift_DependencyContainer::getInstance() |
538 | 538 | ->register('mime.qpheaderencoder') |
539 | 539 | ->asAliasOf('mime.base64headerencoder'); |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | 'EXTRACT' => 'Eccube\Doctrine\ORM\Query\Extract', |
661 | 661 | ), |
662 | 662 | )); |
663 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
663 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
664 | 664 | // tax_rule |
665 | 665 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
666 | 666 | $taxRuleRepository->setApplication($app); |
@@ -756,31 +756,31 @@ discard block |
||
756 | 756 | array('^/mypage', 'ROLE_USER', $channel), |
757 | 757 | ); |
758 | 758 | |
759 | - $this['eccube.password_encoder'] = function ($app) { |
|
759 | + $this['eccube.password_encoder'] = function($app) { |
|
760 | 760 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
761 | 761 | }; |
762 | - $this['security.encoder_factory'] = function ($app) { |
|
762 | + $this['security.encoder_factory'] = function($app) { |
|
763 | 763 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
764 | 764 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
765 | 765 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
766 | 766 | )); |
767 | 767 | }; |
768 | - $this['eccube.event_listner.security'] = function ($app) { |
|
768 | + $this['eccube.event_listner.security'] = function($app) { |
|
769 | 769 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
770 | 770 | }; |
771 | 771 | |
772 | 772 | // Voterの設定 |
773 | - $this['authority_voter'] = function ($app) { |
|
773 | + $this['authority_voter'] = function($app) { |
|
774 | 774 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
775 | 775 | }; |
776 | 776 | |
777 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
777 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
778 | 778 | $voters[] = $app['authority_voter']; |
779 | 779 | |
780 | 780 | return $voters; |
781 | 781 | }); |
782 | 782 | |
783 | - $this['security.access_manager'] = function ($app) { |
|
783 | + $this['security.access_manager'] = function($app) { |
|
784 | 784 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
785 | 785 | }; |
786 | 786 | |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | { |
795 | 795 | $config = $this['config']; |
796 | 796 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
797 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
797 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
798 | 798 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
799 | 799 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
800 | 800 | }, self::EARLY_EVENT); |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | $app = $this; |
955 | 955 | |
956 | 956 | // Response Event(http cache対応、event実行は一番遅く設定) |
957 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
957 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
958 | 958 | |
959 | 959 | if (!$event->isMasterRequest()) { |
960 | 960 | return; |