Skip to content

Commit

Permalink
Breaking: Change Vendor name to Unikka
Browse files Browse the repository at this point in the history
The package was published as noedisch package before but is not available anymore.
Now we adjust the vendor name and name space to fit the unikka eco system.

The package was authored by me under the MIT license and so we continue now
as an unikka package.

BREAKING CHANGE: Vendor name and namespace change
  • Loading branch information
markusguenther committed Sep 3, 2019
1 parent 5777cbc commit 7ee2942
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 84 deletions.
18 changes: 9 additions & 9 deletions Classes/Command/CheckLinksCommandController.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Command;
namespace Unikka\LinkChecker\Command;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -15,21 +15,21 @@
use GuzzleHttp\RequestOptions;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
use Noerdisch\LinkChecker\Profile\CheckAllLinks;
use Noerdisch\LinkChecker\Reporter\LogBrokenLinks;
use Noerdisch\LinkChecker\Service\NotificationServiceInterface;
use Unikka\LinkChecker\Profile\CheckAllLinks;
use Unikka\LinkChecker\Reporter\LogBrokenLinks;
use Unikka\LinkChecker\Service\NotificationServiceInterface;
use Spatie\Crawler\Crawler;

/**
* Class CheckLinksCommandController
* @package Noerdisch\LinkChecker\Command
* @package Unikka\LinkChecker\Command
*/
class CheckLinksCommandController extends CommandController
{
public const MIN_STATUS_CODE = 404;

/**
* @Flow\InjectConfiguration(package="Noerdisch.LinkChecker")
* @Flow\InjectConfiguration(package="Unikka.LinkChecker")
* @var array
*/
protected $settings;
Expand Down Expand Up @@ -137,7 +137,7 @@ protected function getConcurrency($concurrency): int
}

/**
* Returns true by default and can be changed by the setting Noerdisch.LinkChecker.ignoreRobots
* Returns true by default and can be changed by the setting Unikka.LinkChecker.ignoreRobots
*
* @return bool
*/
Expand Down
10 changes: 5 additions & 5 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Controller;
namespace Unikka\LinkChecker\Controller;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -14,11 +14,11 @@

use Neos\Flow\Annotations as Flow;
use Neos\Neos\Controller\Module\AbstractModuleController;
use Noerdisch\LinkChecker\Domain\Repository\ResultItemRepository;
use Unikka\LinkChecker\Domain\Repository\ResultItemRepository;

/**
* Class BackendController
* @package Noerdisch\LinkChecker\Controller
* @package Unikka\LinkChecker\Controller
*/
class BackendController extends AbstractModuleController
{
Expand Down
10 changes: 5 additions & 5 deletions Classes/Domain/Model/ResultItem.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php

namespace Noerdisch\LinkChecker\Domain\Model;
namespace Unikka\LinkChecker\Domain\Model;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use Neos\Flow\Annotations as Flow;
use Noerdisch\LinkChecker\Service\UriService;
use Unikka\LinkChecker\Service\UriService;
use Psr\Http\Message\UriInterface;

/**
* Model ResultItem
*
* @package Noerdisch\LinkChecker\Domain\Model
* @package Unikka\LinkChecker\Domain\Model
* @Flow\Entity
*/
class ResultItem
Expand Down
10 changes: 5 additions & 5 deletions Classes/Domain/Repository/ResultItemRepository.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Domain\Repository;
namespace Unikka\LinkChecker\Domain\Repository;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -14,7 +14,7 @@

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Persistence\Doctrine\Repository;
use Noerdisch\LinkChecker\Domain\Model\ResultItem;
use Unikka\LinkChecker\Domain\Model\ResultItem;

/**
* @Flow\Scope("singleton")
Expand Down Expand Up @@ -65,7 +65,7 @@ public function findExistingItems($url, $originUrl)
*/
public function findAllStatusCodes()
{
$dql = "SELECT DISTINCT t.statusCode FROM Noerdisch\LinkChecker\Domain\Model\ResultItem t ";
$dql = "SELECT DISTINCT t.statusCode FROM Unikka\LinkChecker\Domain\Model\ResultItem t ";
$dql .= "WHERE t.statusCode > 0 ORDER BY t.statusCode ASC";
$statusCodes = $this->createDqlQuery($dql)->getArrayResult();

Expand Down
8 changes: 4 additions & 4 deletions Classes/Profile/CheckAllLinks.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Profile;
namespace Unikka\LinkChecker\Profile;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -16,7 +16,7 @@

/**
* Class CheckAllLinks
* @package Noerdisch\LinkChecker\Reporter
* @package Unikka\LinkChecker\Reporter
*/
class CheckAllLinks extends CrawlAllUrls
{
Expand Down
12 changes: 6 additions & 6 deletions Classes/Reporter/BaseReporter.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Reporter;
namespace Unikka\LinkChecker\Reporter;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -15,16 +15,16 @@
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\ConsoleOutput;
use Neos\Flow\Persistence\Exception\IllegalObjectTypeException;
use Noerdisch\LinkChecker\Domain\Model\ResultItem;
use Noerdisch\LinkChecker\Domain\Repository\ResultItemRepository;
use Unikka\LinkChecker\Domain\Model\ResultItem;
use Unikka\LinkChecker\Domain\Repository\ResultItemRepository;
use Spatie\Crawler\CrawlObserver;
use Psr\Http\Message\UriInterface;
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Exception\RequestException;

/**
* Class BaseReporter
* @package Noerdisch\LinkChecker\Reporter
* @package Unikka\LinkChecker\Reporter
*/
abstract class BaseReporter extends CrawlObserver
{
Expand Down
8 changes: 4 additions & 4 deletions Classes/Reporter/LogBrokenLinks.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Reporter;
namespace Unikka\LinkChecker\Reporter;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -17,7 +17,7 @@

/**
* Class LogBrokenLinks
* @package Noerdisch\LinkChecker\Reporter
* @package Unikka\LinkChecker\Reporter
*/
class LogBrokenLinks extends BaseReporter
{
Expand Down
14 changes: 7 additions & 7 deletions Classes/Service/EmailService.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Service;
namespace Unikka\LinkChecker\Service;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -18,7 +18,7 @@
use Neos\FluidAdaptor\View\StandaloneView;
use Neos\SwiftMailer\Message;
use League\Csv\Writer;
use Noerdisch\LinkChecker\Domain\Model\ResultItem;
use Unikka\LinkChecker\Domain\Model\ResultItem;
use Swift_Attachment;

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ protected function generateCsvAttachment(array $variables) {
*/
public function renderEmailBody(string $format, array $variables): string
{
$packageName = $this->template['package'] ?? 'Noerdisch.LinkChecker';
$packageName = $this->template['package'] ?? 'Unikka.LinkChecker';
$templateName = $this->template['file'] ?? 'NotificationMail';
$rootPath = sprintf('resource://%s/Private/Notification/', $packageName);
$templatePathAndFilename = $rootPath . sprintf('Templates/%s.%s', $templateName, $format);
Expand Down Expand Up @@ -218,12 +218,12 @@ protected function resolveAddress($addressKeyOrAddresses, $addressesConfig, $des
}
if (!isset($addressesConfig[$addressKeyOrAddresses])) {
$errorMessage = 'The given address string was not found in config. Please check config path';
$errorMessage .= ' "Noerdisch.LinkChecker.%s.%s".';
$errorMessage .= ' "Unikka.LinkChecker.%s.%s".';
throw new \RuntimeException(sprintf($errorMessage, $description, $addressKeyOrAddresses), 1540192171);
}
if (!isset($addressesConfig[$addressKeyOrAddresses]['name'], $addressesConfig[$addressKeyOrAddresses]['address'])) {
$errorMessage = 'The given sender is not correctly configured - "name" or "address" are missing.';
$errorMessage .= ' Please check config path "Noerdisch.LinkChecker.%s.%s".';
$errorMessage .= ' Please check config path "Unikka.LinkChecker.%s.%s".';
throw new \RuntimeException(sprintf($errorMessage, $description, $addressKeyOrAddresses), 1540192180);
}
return [$addressesConfig[$addressKeyOrAddresses]['address'] => $addressesConfig[$addressKeyOrAddresses]['name']];
Expand Down
8 changes: 4 additions & 4 deletions Classes/Service/NotificationServiceInterface.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Service;
namespace Unikka\LinkChecker\Service;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand All @@ -14,7 +14,7 @@

/**
* Class AbstractNotificationService
* @package Noerdisch\LinkChecker\Service
* @package Unikka\LinkChecker\Service
*/
interface NotificationServiceInterface
{
Expand Down
6 changes: 3 additions & 3 deletions Classes/Service/UriService.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Noerdisch\LinkChecker\Service;
namespace Unikka\LinkChecker\Service;

/*
* This file is part of the Noerdisch.LinkChecker package.
* This file is part of the Unikka LinkChecker package.
*
* (c) Noerdisch - Digital Solutions www.noerdisch.com
* (c) unikka
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
Expand Down
6 changes: 3 additions & 3 deletions Configuration/Policy.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# Security policies for Noerdisch.LinkChecker package
# Security policies for Unikka.LinkChecker package
#
privilegeTargets:
'Neos\Neos\Security\Authorization\Privilege\ModulePrivilege':
'Noerdisch.LinkChecker:Backend.Module.Management.LinkChecker':
'Unikka.LinkChecker:Backend.Module.Management.LinkChecker':
matcher: 'management/linkchecker'

roles:
'Neos.Neos:AbstractEditor':
privileges:
-
privilegeTarget: 'Noerdisch.LinkChecker:Backend.Module.Management.LinkChecker'
privilegeTarget: 'Unikka.LinkChecker:Backend.Module.Management.LinkChecker'
permission: GRANT
20 changes: 10 additions & 10 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Noerdisch:
Unikka:
LinkChecker:
url: ''
defaultProfile: 'Noerdisch\LinkChecker\Profile\CheckAllLinks'
defaultReporter: 'Noerdisch\LinkChecker\Reporter\LogBrokenLinks'
defaultProfile: 'Unikka\LinkChecker\Profile\CheckAllLinks'
defaultReporter: 'Unikka\LinkChecker\Reporter\LogBrokenLinks'
concurrency: 10
ignoreRobots: true
excludeStatusCodes: []
Expand All @@ -14,20 +14,20 @@ Noerdisch:
auth: []
notifications:
enabled: true
service: 'Noerdisch\LinkChecker\Service\EmailService'
service: 'Unikka\LinkChecker\Service\EmailService'
subject: 'Link checker results'
minimumStatusCode: 400
mail:
sender:
default:
name: 'Noerdisch'
name: 'Unikka'
address: '[email protected]'
recipient:
default:
name: 'Noerdisch'
name: 'Unikka'
address: '[email protected]'
template:
package: 'Noerdisch.LinkChecker'
package: 'Unikka.LinkChecker'
file: 'NotificationMail'
attachment:
enableMailAttachment: true
Expand All @@ -45,13 +45,13 @@ Neos:
userInterface:
translation:
autoInclude:
'Noerdisch.LinkChecker': ['Modules']
'Unikka.LinkChecker': ['Modules']
modules:
management:
submodules:
linkchecker:
label: 'Link Checker Module'
controller: 'Noerdisch\LinkChecker\Controller\BackendController'
controller: 'Unikka\LinkChecker\Controller\BackendController'
description: 'Backend Modules for listing crawling states for URLs and images'
icon: 'fas fa-link'
privilegeTarget: 'Noerdisch.LinkChecker:Backend.Module.Management.LinkChecker'
privilegeTarget: 'Unikka.LinkChecker:Backend.Module.Management.LinkChecker'
Loading

0 comments on commit 7ee2942

Please sign in to comment.