|
| __construct (ObjectManagerInterface $objectManager, CurlTransport $curl) |
|
Checks if .htaccess is identical to .htaccess.sample.
Definition at line 18 of file HtaccessAnalyzer.php.
◆ __construct()
__construct |
( |
ObjectManagerInterface |
$objectManager, |
|
|
CurlTransport |
$curl |
|
) |
| |
- Parameters
-
ObjectManagerInterface | $objectManager | |
CurlTransport | $curl | |
Definition at line 45 of file HtaccessAnalyzer.php.
49 parent::__construct();
◆ configure()
Configure command.
- Returns
- void
Definition at line 59 of file HtaccessAnalyzer.php.
62 $this->setName(
'troubleshooting:check-htaccess')
63 ->setDescription(
'Check .htaccess file is present. It is needed to run cli commands via browser url.');
◆ execute()
execute |
( |
InputInterface |
$input, |
|
|
OutputInterface |
$output |
|
) |
| |
|
protected |
Execute command.
- Parameters
-
InputInterface | $input | |
OutputInterface | $output | |
- Returns
- void @SuppressWarnings(PHPMD.UnusedFormalParameter)
Definition at line 74 of file HtaccessAnalyzer.php.
76 \PHPUnit\Util\Configuration::getInstance(MTF_PHPUNIT_FILE)->handlePHPConfiguration();
77 $output = $this->objectManager->create(
82 $output->writeln(
"Checking .htaccess file...");
83 $this->curl->write($_ENV[
'app_frontend_url'] . $this->commandPath, [], CurlInterface::GET);
85 $responseCode = $this->curl->getInfo(CURLINFO_HTTP_CODE);
86 if ($responseCode != 200) {
87 $message[
'error'][] =
'Your .htaccess file doesn\'t exist. ' 88 .
'Please, create it from to .htaccess.sample.';
92 }
catch (\Exception $e) {
93 $output->outputMessages([
'error' => [$e->getMessage()]]);
95 $output->writeln(
".htaccess check finished.");
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/functional/lib/Magento/Mtf/Troubleshooting/HtaccessAnalyzer.php