Skip to content

Commit

Permalink
[!!!][TASK] Switch to Symfony Console command, close #1
Browse files Browse the repository at this point in the history
This commit is breaking because it removes support for TYPO3 7.6 LTS by switching to
Symfony Console commands as described in the following link:
https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.4/Deprecation-85977-ExtbaseCommandControllersAndCliAnnotation.html
  • Loading branch information
runepiper committed Oct 10, 2018
1 parent 80546e3 commit 084b79b
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 52 deletions.
44 changes: 44 additions & 0 deletions Classes/Command/FetchWebsiteCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace VV\T3fetch\Command;

use TYPO3\CMS\Core\Core\Environment;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class FetchWebsiteCommand extends Command
{
/**
* Configure the command by defining the name, options and arguments
*/
protected function configure()
{
$this
->setDescription('Fetches a website (including all subpages), so the TYPO3 cache gets filled.')
->addArgument(
'baseUrl',
InputArgument::REQUIRED,
'The base url.'
);;
}

/**
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$fetchDirectory = Environment::getPublicPath() . '/typo3temp/t3fetch';

// Remove fetch directory
exec('rm -rf ' . $fetchDirectory);

// Create fetch directory
exec('mkdir ' . $fetchDirectory);

// Fetch website recursively
exec('wget -q -r ' . $input->getArgument('baseUrl') . ' -P ' . $fetchDirectory);
}
}
37 changes: 0 additions & 37 deletions Classes/Command/FetchWebsiteCommandController.php

This file was deleted.

8 changes: 8 additions & 0 deletions Configuration/Commands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

return [
'fetchWebsite:fetchAll' => [
'class' => \VV\T3fetch\Command\FetchWebsiteCommand::class,
'schedulable' => true,
],
];
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Fetches a website (including all subpages), so the TYPO3 cache gets filled.

## How to use
1. Install TYPO3 extension via [composer](https://packagist.org/packages/visuellverstehen/t3fetch), [TER](https://extensions.typo3.org/extension/t3fetch/) or download and install manually.
2. Call command `fetchWebsite:fetchAll` via CLI or add scheduler task.
2. Call command `fetchWebsite:fetchAll` via CLI or add scheduler task (_Execute console commands_ and then select `fetchWebsite:fetchAll`).

## Requirements
- Wget needs to be installed.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
}
],
"require": {
"typo3/cms-core": ">=7.6 <=9.5",
"php": "^7.0.0"
"typo3/cms-core": ">=8.7 <=9.5",
"php": "^7.1.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
'author' => 'visuellverstehen',
'author_email' => '[email protected]',
'author_company' => 'visuellverstehen',
'state' => 'beta',
'state' => 'stable',
'clearCacheOnLoad' => false,
'version' => '0.2.0',
'version' => '1.0.0',
'constraints' => [
'depends' => [
'typo3' => '7.6.0-9.5.99',
'typo3' => '8.7.0-9.5.99',
]
]
];
9 changes: 0 additions & 9 deletions ext_localconf.php

This file was deleted.

0 comments on commit 084b79b

Please sign in to comment.