Skip to content

Commit

Permalink
!!! [TASK] Remove deprecated tableName properties, replaced by consta…
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasnorre committed Jun 1, 2021
1 parent 670ef4f commit 727a368
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 36 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,10 @@
### Removed
#### Classes
#### Functions & Properties
* CrawlerController->tableName
* ConfigurationRepository->tableName
* ProcessRepository->tableName
* QueueRepository->tableName

## Crawler 9.2.5
Crawler 9.2.5 was released on May 28th, 2021
Expand Down
30 changes: 12 additions & 18 deletions Classes/Controller/CrawlerController.php
Expand Up @@ -196,12 +196,6 @@ class CrawlerController implements LoggerAwareInterface
*/
protected $configurationRepository;

/**
* @var string
* @deprecated Since v9.2.5 - This will be remove in v10
*/
protected $tableName = 'tx_crawler_queue';

/**
* @var QueueExecutor
*/
Expand Down Expand Up @@ -847,17 +841,17 @@ public function compileUrls(array $paramArray, array $urls): array
*/
public function getLogEntriesForPageId($id, QueueFilter $queueFilter, $doFlush = false, $doFullFlush = false, $itemsPerPage = 10)
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->tableName);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(QueueRepository::TABLE_NAME);
$queryBuilder
->select('*')
->from($this->tableName)
->from(QueueRepository::TABLE_NAME)
->where(
$queryBuilder->expr()->eq('page_id', $queryBuilder->createNamedParameter($id, PDO::PARAM_INT))
)
->orderBy('scheduled', 'DESC');

$expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable($this->tableName)
->getConnectionForTable(QueueRepository::TABLE_NAME)
->getExpressionBuilder();
$query = $expressionBuilder->andX();
// PHPStorm adds the highlight that the $addWhere is immediately overwritten,
Expand Down Expand Up @@ -896,17 +890,17 @@ public function getLogEntriesForPageId($id, QueueFilter $queueFilter, $doFlush =
*/
public function getLogEntriesForSetId(int $set_id, string $filter = '', bool $doFlush = false, bool $doFullFlush = false, int $itemsPerPage = 10)
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->tableName);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(QueueRepository::TABLE_NAME);
$queryBuilder
->select('*')
->from($this->tableName)
->from(QueueRepository::TABLE_NAME)
->where(
$queryBuilder->expr()->eq('set_id', $queryBuilder->createNamedParameter($set_id, PDO::PARAM_INT))
)
->orderBy('scheduled', 'DESC');

$expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable($this->tableName)
->getConnectionForTable(QueueRepository::TABLE_NAME)
->getExpressionBuilder();
$query = $expressionBuilder->andX();
// PHPStorm adds the highlight that the $addWhere is immediately overwritten,
Expand Down Expand Up @@ -1589,7 +1583,7 @@ public function CLI_checkAndAcquireNewProcess($id)
*/
public function CLI_releaseProcesses($releaseIds)
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->tableName);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(QueueRepository::TABLE_NAME);

if (! is_array($releaseIds)) {
$releaseIds = [$releaseIds];
Expand Down Expand Up @@ -1693,19 +1687,19 @@ protected function flushQueue($where = ''): void
{
$realWhere = strlen((string) $where) > 0 ? $where : '1=1';

$queryBuilder = $this->getQueryBuilder($this->tableName);
$queryBuilder = $this->getQueryBuilder(QueueRepository::TABLE_NAME);

$groups = $queryBuilder
->selectLiteral('DISTINCT set_id')
->from($this->tableName)
->from(QueueRepository::TABLE_NAME)
->where($realWhere)
->execute()
->fetchAll();
if (is_array($groups)) {
foreach ($groups as $group) {
$subSet = $queryBuilder
->select('qid', 'set_id')
->from($this->tableName)
->from(QueueRepository::TABLE_NAME)
->where(
$realWhere,
$queryBuilder->expr()->eq('set_id', $group['set_id'])
Expand All @@ -1723,7 +1717,7 @@ protected function flushQueue($where = ''): void
}

$queryBuilder
->delete($this->tableName)
->delete(QueueRepository::TABLE_NAME)
->where($realWhere)
->execute();
}
Expand All @@ -1745,7 +1739,7 @@ protected function getDuplicateRowsIfExist($tstamp, $fieldArray)

$currentTime = $this->getCurrentTime();

$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->tableName);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(QueueRepository::TABLE_NAME);
$queryBuilder
->select('qid')
->from(QueueRepository::TABLE_NAME);
Expand Down
6 changes: 0 additions & 6 deletions Classes/Domain/Repository/ConfigurationRepository.php
Expand Up @@ -35,12 +35,6 @@ class ConfigurationRepository extends Repository
{
public const TABLE_NAME = 'tx_crawler_configuration';

/**
* @var string
* @deprecated Since v9.2.5 - This will be remove in v10
*/
protected $tableName = 'tx_crawler_configuration';

public function getCrawlerConfigurationRecords(): array
{
$records = [];
Expand Down
6 changes: 0 additions & 6 deletions Classes/Domain/Repository/ProcessRepository.php
Expand Up @@ -46,12 +46,6 @@ class ProcessRepository extends Repository
{
public const TABLE_NAME = 'tx_crawler_process';

/**
* @var string
* @deprecated Since v9.2.5 - This will be remove in v10
*/
protected $tableName = 'tx_crawler_process';

/**
* @var QueryBuilder
*/
Expand Down
6 changes: 0 additions & 6 deletions Classes/Domain/Repository/QueueRepository.php
Expand Up @@ -49,12 +49,6 @@ class QueueRepository extends Repository implements LoggerAwareInterface

public const TABLE_NAME = 'tx_crawler_queue';

/**
* @var string
* @deprecated Since v9.2.5 - This will be remove in v10
*/
protected $tableName = 'tx_crawler_queue';

/**
* @var array
*/
Expand Down

0 comments on commit 727a368

Please sign in to comment.