@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $variables['docsUrl'] = self::DOCUMENTATION_URL; |
| 198 | 198 | $variables['pluginName'] = $pluginName; |
| 199 | 199 | $variables['title'] = $templateTitle; |
| 200 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 200 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 201 | 201 | $variables['crumbs'] = [ |
| 202 | 202 | [ |
| 203 | 203 | 'label' => $pluginName, |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | ], |
| 206 | 206 | [ |
| 207 | 207 | 'label' => 'Redirects', |
| 208 | - 'url' => UrlHelper::cpUrl('retour/redirects' . $siteHandleUri), |
|
| 208 | + 'url' => UrlHelper::cpUrl('retour/redirects'.$siteHandleUri), |
|
| 209 | 209 | ], |
| 210 | 210 | ]; |
| 211 | 211 | $variables['docTitle'] = "{$pluginName} - Redirects - {$templateTitle}"; |
@@ -215,14 +215,14 @@ discard block |
||
| 215 | 215 | $file = UploadedFile::getInstanceByName('file'); |
| 216 | 216 | if ($file !== null) { |
| 217 | 217 | $filename = uniqid($file->name, true); |
| 218 | - $filePath = Craft::$app->getPath()->getTempPath() . DIRECTORY_SEPARATOR . $filename; |
|
| 218 | + $filePath = Craft::$app->getPath()->getTempPath().DIRECTORY_SEPARATOR.$filename; |
|
| 219 | 219 | $file->saveAs($filePath, false); |
| 220 | 220 | // Also save the file to the cache as a backup way to access it |
| 221 | 221 | $cache = Craft::$app->getCache(); |
| 222 | 222 | $fileHandle = fopen($filePath, 'r'); |
| 223 | 223 | if ($fileHandle) { |
| 224 | 224 | $fileContents = null; |
| 225 | - while(feof($fileHandle) !== true) { |
|
| 225 | + while (feof($fileHandle) !== true) { |
|
| 226 | 226 | $fileContents .= fgets($fileHandle); |
| 227 | 227 | } |
| 228 | 228 | if ($fileContents) { |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | $csv->insertOne(array_values($columns)); |
| 358 | 358 | $csv->insertAll($data); |
| 359 | - $csv->output($filename . '.csv'); |
|
| 359 | + $csv->output($filename.'.csv'); |
|
| 360 | 360 | exit(0); |
| 361 | 361 | } |
| 362 | 362 | |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | $csv->setOffset(1); |
| 373 | 373 | $columns = ArrayHelper::filterEmptyStringsFromArray($columns); |
| 374 | 374 | $rowIndex = 1; |
| 375 | - $csv->each(function ($row) use ($headers, $columns, &$rowIndex, &$hasErrors) { |
|
| 375 | + $csv->each(function($row) use ($headers, $columns, &$rowIndex, &$hasErrors) { |
|
| 376 | 376 | $redirectConfig = [ |
| 377 | 377 | 'id' => 0, |
| 378 | 378 | ]; |
@@ -386,9 +386,9 @@ discard block |
||
| 386 | 386 | $index++; |
| 387 | 387 | } |
| 388 | 388 | $redirectDump = print_r($redirectConfig, true); |
| 389 | - Craft::debug("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 389 | + Craft::debug("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 390 | 390 | if (!Retour::$plugin->redirects->saveRedirect($redirectConfig)) { |
| 391 | - Craft::info("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 391 | + Craft::info("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 392 | 392 | $hasErrors = true; |
| 393 | 393 | } |
| 394 | 394 | $rowIndex++; |
@@ -428,9 +428,9 @@ discard block |
||
| 428 | 428 | $index++; |
| 429 | 429 | } |
| 430 | 430 | $redirectDump = print_r($redirectConfig, true); |
| 431 | - Craft::debug("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 431 | + Craft::debug("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 432 | 432 | if (!Retour::$plugin->redirects->saveRedirect($redirectConfig)) { |
| 433 | - Craft::info("-> ROW #$rowIndex contents: " . $redirectDump, __METHOD__); |
|
| 433 | + Craft::info("-> ROW #$rowIndex contents: ".$redirectDump, __METHOD__); |
|
| 434 | 434 | $hasErrors = true; |
| 435 | 435 | } |
| 436 | 436 | $rowIndex++; |