mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Migrate dev-specific configuration to env vars via .env file
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@ docs/mercure.html
|
|||||||
docker-compose.override.yml
|
docker-compose.override.yml
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
docs/swagger/swagger-inlined.json
|
docs/swagger/swagger-inlined.json
|
||||||
|
shlink-dev.local.env
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Shlinkio\Shlink;
|
|
||||||
|
|
||||||
use Shlinkio\Shlink\Core\Config\EnvVars;
|
|
||||||
|
|
||||||
return (static function (): array {
|
|
||||||
$threshold = EnvVars::DELETE_SHORT_URL_THRESHOLD->loadFromEnv();
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'delete_short_urls' => [
|
|
||||||
'check_visits_threshold' => $threshold !== null,
|
|
||||||
'visits_threshold' => (int) ($threshold ?? DEFAULT_DELETE_SHORT_URL_THRESHOLD),
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
})();
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'entity_manager' => [
|
|
||||||
'connection' => [
|
|
||||||
// MySQL
|
|
||||||
'user' => 'root',
|
|
||||||
'password' => 'root',
|
|
||||||
'driver' => 'pdo_mysql',
|
|
||||||
'host' => 'shlink_db_mysql',
|
|
||||||
'dbname' => 'shlink',
|
|
||||||
// 'dbname' => 'shlink_foo',
|
|
||||||
'charset' => 'utf8mb4',
|
|
||||||
|
|
||||||
// MariaDB
|
|
||||||
// 'user' => 'root',
|
|
||||||
// 'password' => 'root',
|
|
||||||
// 'driver' => 'pdo_mysql',
|
|
||||||
// 'host' => 'shlink_db_maria',
|
|
||||||
// 'dbname' => 'shlink_foo',
|
|
||||||
// 'charset' => 'utf8mb4',
|
|
||||||
|
|
||||||
// Postgres
|
|
||||||
// 'user' => 'postgres',
|
|
||||||
// 'password' => 'root',
|
|
||||||
// 'driver' => 'pdo_pgsql',
|
|
||||||
// 'host' => 'shlink_db_postgres',
|
|
||||||
// 'dbname' => 'shlink_foo',
|
|
||||||
// 'charset' => 'utf8',
|
|
||||||
|
|
||||||
// MSSQL
|
|
||||||
// 'user' => 'sa',
|
|
||||||
// 'password' => 'Passw0rd!',
|
|
||||||
// 'driver' => 'pdo_sqlsrv',
|
|
||||||
// 'host' => 'shlink_db_ms',
|
|
||||||
// 'dbname' => 'shlink_foo',
|
|
||||||
// 'driverOptions' => [
|
|
||||||
// 'TrustServerCertificate' => 'true',
|
|
||||||
// ],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use Shlinkio\Shlink\Core\Config\EnvVars;
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'matomo' => [
|
|
||||||
'enabled' => (bool) EnvVars::MATOMO_ENABLED->loadFromEnv(),
|
|
||||||
'base_url' => EnvVars::MATOMO_BASE_URL->loadFromEnv(),
|
|
||||||
'site_id' => EnvVars::MATOMO_SITE_ID->loadFromEnv(),
|
|
||||||
'api_token' => EnvVars::MATOMO_API_TOKEN->loadFromEnv(),
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Dev matomo instance needs to be manually configured once before enabling the configuration below.
|
|
||||||
*
|
|
||||||
* 1. Go to http://localhost:8003 and follow the installation instructions.
|
|
||||||
* 2. Open data/infra/matomo/config/config.ini.php and replace `trusted_hosts[] = "localhost"` with
|
|
||||||
* `trusted_hosts[] = "localhost:8003"` (see https://github.com/matomo-org/matomo/issues/9549)
|
|
||||||
* 3. Go to http://localhost:8003/index.php?module=SitesManager&action=index and paste the ID for the site you just
|
|
||||||
* created into the `site_id` field below.
|
|
||||||
* 4. Go to http://localhost:8003/index.php?module=UsersManager&action=userSecurity, scroll down, click
|
|
||||||
* "Create new token" and once generated, paste the token into the `api_token` field below.
|
|
||||||
*/
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'matomo' => [
|
|
||||||
// 'enabled' => true,
|
|
||||||
// 'base_url' => 'http://shlink_matomo',
|
|
||||||
// 'site_id' => '...',
|
|
||||||
// 'api_token' => '...',
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -8,34 +8,31 @@ use Shlinkio\Shlink\Core\Config\EnvVars;
|
|||||||
use Symfony\Component\Mercure\Hub;
|
use Symfony\Component\Mercure\Hub;
|
||||||
use Symfony\Component\Mercure\HubInterface;
|
use Symfony\Component\Mercure\HubInterface;
|
||||||
|
|
||||||
return (static function (): array {
|
return [
|
||||||
$publicUrl = EnvVars::MERCURE_PUBLIC_HUB_URL->loadFromEnv();
|
|
||||||
|
|
||||||
return [
|
// This config is used by shlink-common. Do not delete
|
||||||
|
'mercure' => [
|
||||||
|
'public_hub_url' => EnvVars::MERCURE_PUBLIC_HUB_URL->loadFromEnv(),
|
||||||
|
'internal_hub_url' => EnvVars::MERCURE_INTERNAL_HUB_URL->loadFromEnv(),
|
||||||
|
'jwt_secret' => EnvVars::MERCURE_JWT_SECRET->loadFromEnv(),
|
||||||
|
'jwt_issuer' => 'Shlink',
|
||||||
|
],
|
||||||
|
|
||||||
'mercure' => [
|
'dependencies' => [
|
||||||
'public_hub_url' => $publicUrl,
|
'delegators' => [
|
||||||
'internal_hub_url' => EnvVars::MERCURE_INTERNAL_HUB_URL->loadFromEnv(),
|
LcobucciJwtProvider::class => [
|
||||||
'jwt_secret' => EnvVars::MERCURE_JWT_SECRET->loadFromEnv(),
|
LazyServiceFactory::class,
|
||||||
'jwt_issuer' => 'Shlink',
|
|
||||||
],
|
|
||||||
|
|
||||||
'dependencies' => [
|
|
||||||
'delegators' => [
|
|
||||||
LcobucciJwtProvider::class => [
|
|
||||||
LazyServiceFactory::class,
|
|
||||||
],
|
|
||||||
Hub::class => [
|
|
||||||
LazyServiceFactory::class,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
'lazy_services' => [
|
Hub::class => [
|
||||||
'class_map' => [
|
LazyServiceFactory::class,
|
||||||
LcobucciJwtProvider::class => LcobucciJwtProvider::class,
|
|
||||||
Hub::class => HubInterface::class,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'lazy_services' => [
|
||||||
|
'class_map' => [
|
||||||
|
LcobucciJwtProvider::class => LcobucciJwtProvider::class,
|
||||||
|
Hub::class => HubInterface::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
})();
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'mercure' => [
|
|
||||||
'public_hub_url' => 'http://localhost:8002',
|
|
||||||
'internal_hub_url' => 'http://shlink_mercure_proxy',
|
|
||||||
'jwt_secret' => 'mercure_jwt_key_long_enough_to_avoid_error',
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use Shlinkio\Shlink\Core\Config\EnvVars;
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'qr_codes' => [
|
|
||||||
'size' => (int) EnvVars::DEFAULT_QR_CODE_SIZE->loadFromEnv(),
|
|
||||||
'margin' => (int) EnvVars::DEFAULT_QR_CODE_MARGIN->loadFromEnv(),
|
|
||||||
'format' => EnvVars::DEFAULT_QR_CODE_FORMAT->loadFromEnv(),
|
|
||||||
'error_correction' => EnvVars::DEFAULT_QR_CODE_ERROR_CORRECTION->loadFromEnv(),
|
|
||||||
'round_block_size' => (bool) EnvVars::DEFAULT_QR_CODE_ROUND_BLOCK_SIZE->loadFromEnv(),
|
|
||||||
'enabled_for_disabled_short_urls' => (bool) EnvVars::QR_CODE_FOR_DISABLED_SHORT_URLS->loadFromEnv(),
|
|
||||||
'color' => EnvVars::DEFAULT_QR_CODE_COLOR->loadFromEnv(),
|
|
||||||
'bg_color' => EnvVars::DEFAULT_QR_CODE_BG_COLOR->loadFromEnv(),
|
|
||||||
'logo_url' => EnvVars::DEFAULT_QR_CODE_LOGO_URL->loadFromEnv(),
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -6,6 +6,7 @@ use Shlinkio\Shlink\Core\Config\EnvVars;
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
|
// This config is used by shlink-common. Do not delete
|
||||||
'rabbitmq' => [
|
'rabbitmq' => [
|
||||||
'enabled' => (bool) EnvVars::RABBITMQ_ENABLED->loadFromEnv(),
|
'enabled' => (bool) EnvVars::RABBITMQ_ENABLED->loadFromEnv(),
|
||||||
'host' => EnvVars::RABBITMQ_HOST->loadFromEnv(),
|
'host' => EnvVars::RABBITMQ_HOST->loadFromEnv(),
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'rabbitmq' => [
|
|
||||||
'enabled' => true,
|
|
||||||
'host' => 'shlink_rabbitmq',
|
|
||||||
'port' => 5672,
|
|
||||||
'user' => 'rabbit',
|
|
||||||
'password' => 'rabbit',
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use Shlinkio\Shlink\Core\Config\EnvVars;
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'not_found_redirects' => [
|
|
||||||
'invalid_short_url' => EnvVars::DEFAULT_INVALID_SHORT_URL_REDIRECT->loadFromEnv(),
|
|
||||||
'regular_404' => EnvVars::DEFAULT_REGULAR_404_REDIRECT->loadFromEnv(),
|
|
||||||
'base_url' => EnvVars::DEFAULT_BASE_URL_REDIRECT->loadFromEnv(),
|
|
||||||
],
|
|
||||||
|
|
||||||
'redirects' => [
|
|
||||||
'redirect_status_code' => (int) EnvVars::REDIRECT_STATUS_CODE->loadFromEnv(),
|
|
||||||
'redirect_cache_lifetime' => (int) EnvVars::REDIRECT_CACHE_LIFETIME->loadFromEnv(),
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'cache' => [
|
|
||||||
'redis' => [
|
|
||||||
'servers' => 'tcp://shlink_redis:6379',
|
|
||||||
// 'servers' => 'tcp://barbar@shlink_redis_acl:6379',
|
|
||||||
// 'servers' => 'tcp://foo:bar@shlink_redis_acl:6379',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
'redis' => [
|
|
||||||
'pub_sub_enabled' => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
'dependencies' => [
|
|
||||||
'aliases' => [
|
|
||||||
// With this config, a user could alias 'lock_store' => 'redis_lock_store' to override the default
|
|
||||||
// 'lock_store' => 'redis_lock_store',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core;
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'robots' => [
|
|
||||||
'allow-all-short-urls' => (bool) Config\EnvVars::ROBOTS_ALLOW_ALL_SHORT_URLS->loadFromEnv(),
|
|
||||||
'user-agents' => splitByComma(Config\EnvVars::ROBOTS_USER_AGENTS->loadFromEnv()),
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -7,7 +7,6 @@ use Mezzio\Router\FastRouteRouter;
|
|||||||
return [
|
return [
|
||||||
|
|
||||||
'router' => [
|
'router' => [
|
||||||
// 'base_path' => '',
|
|
||||||
'fastroute' => [
|
'fastroute' => [
|
||||||
FastRouteRouter::CONFIG_CACHE_ENABLED => false,
|
FastRouteRouter::CONFIG_CACHE_ENABLED => false,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use Shlinkio\Shlink\Core\Config\EnvVars;
|
|
||||||
|
|
||||||
use function Shlinkio\Shlink\Core\splitByComma;
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'tracking' => [
|
|
||||||
// Tells if IP addresses should be anonymized before persisting, to fulfil data protection regulations
|
|
||||||
// This applies only if IP address tracking is enabled
|
|
||||||
'anonymize_remote_addr' => (bool) EnvVars::ANONYMIZE_REMOTE_ADDR->loadFromEnv(),
|
|
||||||
|
|
||||||
// Tells if visits to not-found URLs should be tracked. The disable_tracking option takes precedence
|
|
||||||
'track_orphan_visits' => (bool) EnvVars::TRACK_ORPHAN_VISITS->loadFromEnv(),
|
|
||||||
|
|
||||||
// A query param that, if provided, will disable tracking of one particular visit. Always takes precedence
|
|
||||||
'disable_track_param' => EnvVars::DISABLE_TRACK_PARAM->loadFromEnv(),
|
|
||||||
|
|
||||||
// If true, visits will not be tracked at all
|
|
||||||
'disable_tracking' => (bool) EnvVars::DISABLE_TRACKING->loadFromEnv(),
|
|
||||||
|
|
||||||
// If true, visits will be tracked, but neither the IP address, nor the location will be resolved
|
|
||||||
'disable_ip_tracking' => (bool) EnvVars::DISABLE_IP_TRACKING->loadFromEnv(),
|
|
||||||
|
|
||||||
// If true, the referrer will not be tracked
|
|
||||||
'disable_referrer_tracking' => (bool) EnvVars::DISABLE_REFERRER_TRACKING->loadFromEnv(),
|
|
||||||
|
|
||||||
// If true, the user agent will not be tracked
|
|
||||||
'disable_ua_tracking' => (bool) EnvVars::DISABLE_UA_TRACKING->loadFromEnv(),
|
|
||||||
|
|
||||||
// A list of IP addresses, patterns or CIDR blocks from which tracking is disabled by default
|
|
||||||
'disable_tracking_from' => splitByComma(EnvVars::DISABLE_TRACKING_FROM->loadFromEnv()),
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use function Shlinkio\Shlink\Config\runningInRoadRunner;
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'url_shortener' => [
|
|
||||||
'domain' => [
|
|
||||||
'schema' => 'http',
|
|
||||||
'hostname' => sprintf('localhost:%s', match (true) {
|
|
||||||
runningInRoadRunner() => '8800',
|
|
||||||
default => '8000',
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
// 'multi_segment_slugs_enabled' => true,
|
|
||||||
// 'trailing_slash_enabled' => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
@@ -33,7 +33,11 @@ services:
|
|||||||
- shlink_rabbitmq
|
- shlink_rabbitmq
|
||||||
- shlink_matomo
|
- shlink_matomo
|
||||||
environment:
|
environment:
|
||||||
LC_ALL: C
|
DEFAULT_DOMAIN: localhost:8000
|
||||||
|
env_file:
|
||||||
|
- path: shlink-dev.env
|
||||||
|
- path: shlink-dev.local.env
|
||||||
|
required: false
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- 'host.docker.internal:host-gateway'
|
- 'host.docker.internal:host-gateway'
|
||||||
|
|
||||||
@@ -59,7 +63,11 @@ services:
|
|||||||
- shlink_rabbitmq
|
- shlink_rabbitmq
|
||||||
- shlink_matomo
|
- shlink_matomo
|
||||||
environment:
|
environment:
|
||||||
LC_ALL: C
|
DEFAULT_DOMAIN: localhost:8800
|
||||||
|
env_file:
|
||||||
|
- path: shlink-dev.env
|
||||||
|
- path: shlink-dev.local.env
|
||||||
|
required: false
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- 'host.docker.internal:host-gateway'
|
- 'host.docker.internal:host-gateway'
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ namespace Shlinkio\Shlink\CLI;
|
|||||||
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
||||||
use Laminas\ServiceManager\Factory\InvokableFactory;
|
use Laminas\ServiceManager\Factory\InvokableFactory;
|
||||||
use Shlinkio\Shlink\Common\Doctrine\NoDbNameConnectionFactory;
|
use Shlinkio\Shlink\Common\Doctrine\NoDbNameConnectionFactory;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainService;
|
use Shlinkio\Shlink\Core\Domain\DomainService;
|
||||||
use Shlinkio\Shlink\Core\Matomo;
|
use Shlinkio\Shlink\Core\Matomo;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\RedirectRule\ShortUrlRedirectRuleService;
|
use Shlinkio\Shlink\Core\RedirectRule\ShortUrlRedirectRuleService;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifier;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ namespace Shlinkio\Shlink\CLI\Command\ShortUrl;
|
|||||||
|
|
||||||
use Shlinkio\Shlink\CLI\Input\ShortUrlDataInput;
|
use Shlinkio\Shlink\CLI\Input\ShortUrlDataInput;
|
||||||
use Shlinkio\Shlink\CLI\Util\ExitCode;
|
use Shlinkio\Shlink\CLI\Util\ExitCode;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\NonUniqueSlugException;
|
use Shlinkio\Shlink\Core\Exception\NonUniqueSlugException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\UrlShortenerInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\UrlShortenerInterface;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\CLI\Factory;
|
namespace Shlinkio\Shlink\CLI\Factory;
|
||||||
|
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\AppOptions;
|
use Shlinkio\Shlink\Core\Config\Options\AppOptions;
|
||||||
use Symfony\Component\Console\Application as CliApp;
|
use Symfony\Component\Console\Application as CliApp;
|
||||||
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
|
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use Closure;
|
|||||||
use GeoIp2\Database\Reader;
|
use GeoIp2\Database\Reader;
|
||||||
use MaxMind\Db\Reader\Metadata;
|
use MaxMind\Db\Reader\Metadata;
|
||||||
use Shlinkio\Shlink\CLI\Exception\GeolocationDbUpdateFailedException;
|
use Shlinkio\Shlink\CLI\Exception\GeolocationDbUpdateFailedException;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\IpGeolocation\Exception\DbUpdateException;
|
use Shlinkio\Shlink\IpGeolocation\Exception\DbUpdateException;
|
||||||
use Shlinkio\Shlink\IpGeolocation\Exception\MissingLicenseException;
|
use Shlinkio\Shlink\IpGeolocation\Exception\MissingLicenseException;
|
||||||
use Shlinkio\Shlink\IpGeolocation\Exception\WrongIpException;
|
use Shlinkio\Shlink\IpGeolocation\Exception\WrongIpException;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Shlinkio\Shlink\CLI\Input;
|
namespace Shlinkio\Shlink\CLI\Input;
|
||||||
|
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlEdition;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlEdition;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\ShortUrlInputFilter;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\ShortUrlInputFilter;
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ use PHPUnit\Framework\MockObject\MockObject;
|
|||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\CLI\Command\Domain\DomainRedirectsCommand;
|
use Shlinkio\Shlink\CLI\Command\Domain\DomainRedirectsCommand;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
||||||
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
||||||
use Shlinkio\Shlink\Core\Domain\Model\DomainItem;
|
use Shlinkio\Shlink\Core\Domain\Model\DomainItem;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
|
||||||
use ShlinkioTest\Shlink\CLI\Util\CliTestUtils;
|
use ShlinkioTest\Shlink\CLI\Util\CliTestUtils;
|
||||||
use Symfony\Component\Console\Tester\CommandTester;
|
use Symfony\Component\Console\Tester\CommandTester;
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ use PHPUnit\Framework\TestCase;
|
|||||||
use Shlinkio\Shlink\CLI\Command\Domain\ListDomainsCommand;
|
use Shlinkio\Shlink\CLI\Command\Domain\ListDomainsCommand;
|
||||||
use Shlinkio\Shlink\CLI\Util\ExitCode;
|
use Shlinkio\Shlink\CLI\Util\ExitCode;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
||||||
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
||||||
use Shlinkio\Shlink\Core\Domain\Model\DomainItem;
|
use Shlinkio\Shlink\Core\Domain\Model\DomainItem;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
|
||||||
use ShlinkioTest\Shlink\CLI\Util\CliTestUtils;
|
use ShlinkioTest\Shlink\CLI\Util\CliTestUtils;
|
||||||
use Symfony\Component\Console\Tester\CommandTester;
|
use Symfony\Component\Console\Tester\CommandTester;
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ use PHPUnit\Framework\MockObject\MockObject;
|
|||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\CLI\Command\ShortUrl\CreateShortUrlCommand;
|
use Shlinkio\Shlink\CLI\Command\ShortUrl\CreateShortUrlCommand;
|
||||||
use Shlinkio\Shlink\CLI\Util\ExitCode;
|
use Shlinkio\Shlink\CLI\Util\ExitCode;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\NonUniqueSlugException;
|
use Shlinkio\Shlink\Core\Exception\NonUniqueSlugException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Laminas\ServiceManager\ServiceManager;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\CLI\Factory\ApplicationFactory;
|
use Shlinkio\Shlink\CLI\Factory\ApplicationFactory;
|
||||||
use Shlinkio\Shlink\Core\Options\AppOptions;
|
use Shlinkio\Shlink\Core\Config\Options\AppOptions;
|
||||||
use ShlinkioTest\Shlink\CLI\Util\CliTestUtils;
|
use ShlinkioTest\Shlink\CLI\Util\CliTestUtils;
|
||||||
|
|
||||||
class ApplicationFactoryTest extends TestCase
|
class ApplicationFactoryTest extends TestCase
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase;
|
|||||||
use Shlinkio\Shlink\CLI\Exception\GeolocationDbUpdateFailedException;
|
use Shlinkio\Shlink\CLI\Exception\GeolocationDbUpdateFailedException;
|
||||||
use Shlinkio\Shlink\CLI\GeoLite\GeolocationDbUpdater;
|
use Shlinkio\Shlink\CLI\GeoLite\GeolocationDbUpdater;
|
||||||
use Shlinkio\Shlink\CLI\GeoLite\GeolocationResult;
|
use Shlinkio\Shlink\CLI\GeoLite\GeolocationResult;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\IpGeolocation\Exception\DbUpdateException;
|
use Shlinkio\Shlink\IpGeolocation\Exception\DbUpdateException;
|
||||||
use Shlinkio\Shlink\IpGeolocation\Exception\MissingLicenseException;
|
use Shlinkio\Shlink\IpGeolocation\Exception\MissingLicenseException;
|
||||||
use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdaterInterface;
|
use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdaterInterface;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use Laminas\ServiceManager\Factory\InvokableFactory;
|
|||||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||||
use Shlinkio\Shlink\Common\Doctrine\EntityRepositoryFactory;
|
use Shlinkio\Shlink\Common\Doctrine\EntityRepositoryFactory;
|
||||||
use Shlinkio\Shlink\Config\Factory\ValinorConfigFactory;
|
use Shlinkio\Shlink\Config\Factory\ValinorConfigFactory;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifier;
|
||||||
use Shlinkio\Shlink\Importer\ImportedLinksProcessorInterface;
|
use Shlinkio\Shlink\Importer\ImportedLinksProcessorInterface;
|
||||||
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
|
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
|
||||||
@@ -24,15 +24,15 @@ return [
|
|||||||
ErrorHandler\NotFoundRedirectHandler::class => ConfigAbstractFactory::class,
|
ErrorHandler\NotFoundRedirectHandler::class => ConfigAbstractFactory::class,
|
||||||
ErrorHandler\NotFoundTemplateHandler::class => InvokableFactory::class,
|
ErrorHandler\NotFoundTemplateHandler::class => InvokableFactory::class,
|
||||||
|
|
||||||
Options\AppOptions::class => [ValinorConfigFactory::class, 'config.app_options'],
|
Config\Options\AppOptions::class => [ValinorConfigFactory::class, 'config.app_options'],
|
||||||
Options\DeleteShortUrlsOptions::class => [ValinorConfigFactory::class, 'config.delete_short_urls'],
|
Config\Options\DeleteShortUrlsOptions::class => [Config\Options\DeleteShortUrlsOptions::class, 'fromEnv'],
|
||||||
Options\NotFoundRedirectOptions::class => [ValinorConfigFactory::class, 'config.not_found_redirects'],
|
Config\Options\NotFoundRedirectOptions::class => [Config\Options\NotFoundRedirectOptions::class, 'fromEnv'],
|
||||||
Options\RedirectOptions::class => [ValinorConfigFactory::class, 'config.redirects'],
|
Config\Options\RedirectOptions::class => [Config\Options\RedirectOptions::class, 'fromEnv'],
|
||||||
Options\UrlShortenerOptions::class => [ValinorConfigFactory::class, 'config.url_shortener'],
|
Config\Options\UrlShortenerOptions::class => [Config\Options\UrlShortenerOptions::class, 'fromEnv'],
|
||||||
Options\TrackingOptions::class => [ValinorConfigFactory::class, 'config.tracking'],
|
Config\Options\TrackingOptions::class => [Config\Options\TrackingOptions::class, 'fromEnv'],
|
||||||
Options\QrCodeOptions::class => [ValinorConfigFactory::class, 'config.qr_codes'],
|
Config\Options\QrCodeOptions::class => [Config\Options\QrCodeOptions::class, 'fromEnv'],
|
||||||
Options\RabbitMqOptions::class => [ValinorConfigFactory::class, 'config.rabbitmq'],
|
Config\Options\RabbitMqOptions::class => [Config\Options\RabbitMqOptions::class, 'fromEnv'],
|
||||||
Options\RobotsOptions::class => [ValinorConfigFactory::class, 'config.robots'],
|
Config\Options\RobotsOptions::class => [Config\Options\RobotsOptions::class, 'fromEnv'],
|
||||||
|
|
||||||
RedirectRule\ShortUrlRedirectRuleService::class => ConfigAbstractFactory::class,
|
RedirectRule\ShortUrlRedirectRuleService::class => ConfigAbstractFactory::class,
|
||||||
RedirectRule\ShortUrlRedirectionResolver::class => ConfigAbstractFactory::class,
|
RedirectRule\ShortUrlRedirectionResolver::class => ConfigAbstractFactory::class,
|
||||||
@@ -101,7 +101,7 @@ return [
|
|||||||
|
|
||||||
Crawling\CrawlingHelper::class => ConfigAbstractFactory::class,
|
Crawling\CrawlingHelper::class => ConfigAbstractFactory::class,
|
||||||
|
|
||||||
Matomo\MatomoOptions::class => [ValinorConfigFactory::class, 'config.matomo'],
|
Matomo\MatomoOptions::class => [Matomo\MatomoOptions::class, 'fromEnv'],
|
||||||
Matomo\MatomoTrackerBuilder::class => ConfigAbstractFactory::class,
|
Matomo\MatomoTrackerBuilder::class => ConfigAbstractFactory::class,
|
||||||
Matomo\MatomoVisitSender::class => ConfigAbstractFactory::class,
|
Matomo\MatomoVisitSender::class => ConfigAbstractFactory::class,
|
||||||
],
|
],
|
||||||
@@ -137,9 +137,9 @@ return [
|
|||||||
Visit\VisitsTracker::class => [
|
Visit\VisitsTracker::class => [
|
||||||
'em',
|
'em',
|
||||||
EventDispatcherInterface::class,
|
EventDispatcherInterface::class,
|
||||||
Options\TrackingOptions::class,
|
Config\Options\TrackingOptions::class,
|
||||||
],
|
],
|
||||||
Visit\RequestTracker::class => [Visit\VisitsTracker::class, Options\TrackingOptions::class],
|
Visit\RequestTracker::class => [Visit\VisitsTracker::class, Config\Options\TrackingOptions::class],
|
||||||
Visit\VisitsDeleter::class => [Visit\Repository\VisitDeleterRepository::class],
|
Visit\VisitsDeleter::class => [Visit\Repository\VisitDeleterRepository::class],
|
||||||
ShortUrl\ShortUrlService::class => [
|
ShortUrl\ShortUrlService::class => [
|
||||||
'em',
|
'em',
|
||||||
@@ -149,7 +149,7 @@ return [
|
|||||||
],
|
],
|
||||||
ShortUrl\ShortUrlListService::class => [
|
ShortUrl\ShortUrlListService::class => [
|
||||||
ShortUrl\Repository\ShortUrlListRepository::class,
|
ShortUrl\Repository\ShortUrlListRepository::class,
|
||||||
Options\UrlShortenerOptions::class,
|
Config\Options\UrlShortenerOptions::class,
|
||||||
],
|
],
|
||||||
Visit\Geolocation\VisitLocator::class => ['em', Visit\Repository\VisitIterationRepository::class],
|
Visit\Geolocation\VisitLocator::class => ['em', Visit\Repository\VisitIterationRepository::class],
|
||||||
Visit\Geolocation\VisitToLocationHelper::class => [IpLocationResolverInterface::class],
|
Visit\Geolocation\VisitToLocationHelper::class => [IpLocationResolverInterface::class],
|
||||||
@@ -157,20 +157,20 @@ return [
|
|||||||
Tag\TagService::class => ['em'],
|
Tag\TagService::class => ['em'],
|
||||||
ShortUrl\DeleteShortUrlService::class => [
|
ShortUrl\DeleteShortUrlService::class => [
|
||||||
'em',
|
'em',
|
||||||
Options\DeleteShortUrlsOptions::class,
|
Config\Options\DeleteShortUrlsOptions::class,
|
||||||
ShortUrl\ShortUrlResolver::class,
|
ShortUrl\ShortUrlResolver::class,
|
||||||
ShortUrl\Repository\ExpiredShortUrlsRepository::class,
|
ShortUrl\Repository\ExpiredShortUrlsRepository::class,
|
||||||
],
|
],
|
||||||
ShortUrl\ShortUrlResolver::class => ['em', Options\UrlShortenerOptions::class],
|
ShortUrl\ShortUrlResolver::class => ['em', Config\Options\UrlShortenerOptions::class],
|
||||||
ShortUrl\ShortUrlVisitsDeleter::class => [
|
ShortUrl\ShortUrlVisitsDeleter::class => [
|
||||||
Visit\Repository\VisitDeleterRepository::class,
|
Visit\Repository\VisitDeleterRepository::class,
|
||||||
ShortUrl\ShortUrlResolver::class,
|
ShortUrl\ShortUrlResolver::class,
|
||||||
],
|
],
|
||||||
ShortUrl\Helper\ShortCodeUniquenessHelper::class => ['em', Options\UrlShortenerOptions::class],
|
ShortUrl\Helper\ShortCodeUniquenessHelper::class => ['em', Config\Options\UrlShortenerOptions::class],
|
||||||
Domain\DomainService::class => ['em', 'config.url_shortener.domain.hostname'],
|
Domain\DomainService::class => ['em', 'config.url_shortener.domain.hostname'],
|
||||||
|
|
||||||
Util\DoctrineBatchHelper::class => ['em'],
|
Util\DoctrineBatchHelper::class => ['em'],
|
||||||
Util\RedirectResponseHelper::class => [Options\RedirectOptions::class],
|
Util\RedirectResponseHelper::class => [Config\Options\RedirectOptions::class],
|
||||||
|
|
||||||
Config\NotFoundRedirectResolver::class => [Util\RedirectResponseHelper::class, 'Logger_Shlink'],
|
Config\NotFoundRedirectResolver::class => [Util\RedirectResponseHelper::class, 'Logger_Shlink'],
|
||||||
|
|
||||||
@@ -188,19 +188,22 @@ return [
|
|||||||
ShortUrl\ShortUrlResolver::class,
|
ShortUrl\ShortUrlResolver::class,
|
||||||
ShortUrl\Helper\ShortUrlStringifier::class,
|
ShortUrl\Helper\ShortUrlStringifier::class,
|
||||||
'Logger_Shlink',
|
'Logger_Shlink',
|
||||||
Options\QrCodeOptions::class,
|
Config\Options\QrCodeOptions::class,
|
||||||
],
|
],
|
||||||
Action\RobotsAction::class => [Crawling\CrawlingHelper::class, Options\RobotsOptions::class],
|
Action\RobotsAction::class => [Crawling\CrawlingHelper::class, Config\Options\RobotsOptions::class],
|
||||||
|
|
||||||
ShortUrl\Resolver\PersistenceShortUrlRelationResolver::class => [
|
ShortUrl\Resolver\PersistenceShortUrlRelationResolver::class => [
|
||||||
'em',
|
'em',
|
||||||
Options\UrlShortenerOptions::class,
|
Config\Options\UrlShortenerOptions::class,
|
||||||
Lock\LockFactory::class,
|
Lock\LockFactory::class,
|
||||||
],
|
],
|
||||||
ShortUrl\Helper\ShortUrlStringifier::class => ['config.url_shortener.domain', 'config.router.base_path'],
|
ShortUrl\Helper\ShortUrlStringifier::class => ['config.url_shortener.domain', 'config.router.base_path'],
|
||||||
ShortUrl\Helper\ShortUrlTitleResolutionHelper::class => ['httpClient', Options\UrlShortenerOptions::class],
|
ShortUrl\Helper\ShortUrlTitleResolutionHelper::class => [
|
||||||
|
'httpClient',
|
||||||
|
Config\Options\UrlShortenerOptions::class,
|
||||||
|
],
|
||||||
ShortUrl\Helper\ShortUrlRedirectionBuilder::class => [
|
ShortUrl\Helper\ShortUrlRedirectionBuilder::class => [
|
||||||
Options\TrackingOptions::class,
|
Config\Options\TrackingOptions::class,
|
||||||
RedirectRule\ShortUrlRedirectionResolver::class,
|
RedirectRule\ShortUrlRedirectionResolver::class,
|
||||||
],
|
],
|
||||||
ShortUrl\Transformer\ShortUrlDataTransformer::class => [ShortUrl\Helper\ShortUrlStringifier::class],
|
ShortUrl\Transformer\ShortUrlDataTransformer::class => [ShortUrl\Helper\ShortUrlStringifier::class],
|
||||||
@@ -209,9 +212,9 @@ return [
|
|||||||
Visit\RequestTracker::class,
|
Visit\RequestTracker::class,
|
||||||
ShortUrl\Helper\ShortUrlRedirectionBuilder::class,
|
ShortUrl\Helper\ShortUrlRedirectionBuilder::class,
|
||||||
Util\RedirectResponseHelper::class,
|
Util\RedirectResponseHelper::class,
|
||||||
Options\UrlShortenerOptions::class,
|
Config\Options\UrlShortenerOptions::class,
|
||||||
],
|
],
|
||||||
ShortUrl\Middleware\TrimTrailingSlashMiddleware::class => [Options\UrlShortenerOptions::class],
|
ShortUrl\Middleware\TrimTrailingSlashMiddleware::class => [Config\Options\UrlShortenerOptions::class],
|
||||||
|
|
||||||
EventDispatcher\PublishingUpdatesGenerator::class => [ShortUrl\Transformer\ShortUrlDataTransformer::class],
|
EventDispatcher\PublishingUpdatesGenerator::class => [ShortUrl\Transformer\ShortUrlDataTransformer::class],
|
||||||
|
|
||||||
|
|||||||
@@ -129,14 +129,14 @@ return (static function (): array {
|
|||||||
EventDispatcher\PublishingUpdatesGenerator::class,
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
||||||
'em',
|
'em',
|
||||||
'Logger_Shlink',
|
'Logger_Shlink',
|
||||||
Options\RabbitMqOptions::class,
|
Config\Options\RabbitMqOptions::class,
|
||||||
],
|
],
|
||||||
EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq::class => [
|
EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq::class => [
|
||||||
RabbitMqPublishingHelper::class,
|
RabbitMqPublishingHelper::class,
|
||||||
EventDispatcher\PublishingUpdatesGenerator::class,
|
EventDispatcher\PublishingUpdatesGenerator::class,
|
||||||
'em',
|
'em',
|
||||||
'Logger_Shlink',
|
'Logger_Shlink',
|
||||||
Options\RabbitMqOptions::class,
|
Config\Options\RabbitMqOptions::class,
|
||||||
],
|
],
|
||||||
EventDispatcher\RedisPubSub\NotifyVisitToRedis::class => [
|
EventDispatcher\RedisPubSub\NotifyVisitToRedis::class => [
|
||||||
RedisPublishingHelper::class,
|
RedisPublishingHelper::class,
|
||||||
@@ -167,7 +167,7 @@ return (static function (): array {
|
|||||||
],
|
],
|
||||||
|
|
||||||
EventDispatcher\Helper\EnabledListenerChecker::class => [
|
EventDispatcher\Helper\EnabledListenerChecker::class => [
|
||||||
Options\RabbitMqOptions::class,
|
Config\Options\RabbitMqOptions::class,
|
||||||
'config.redis.pub_sub_enabled',
|
'config.redis.pub_sub_enabled',
|
||||||
MercureOptions::class,
|
MercureOptions::class,
|
||||||
GeoLite2Options::class,
|
GeoLite2Options::class,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use Endroid\QrCode\Writer\PngWriter;
|
|||||||
use Endroid\QrCode\Writer\SvgWriter;
|
use Endroid\QrCode\Writer\SvgWriter;
|
||||||
use Endroid\QrCode\Writer\WriterInterface;
|
use Endroid\QrCode\Writer\WriterInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\QrCodeOptions;
|
use Shlinkio\Shlink\Core\Config\Options\QrCodeOptions;
|
||||||
|
|
||||||
use function ctype_xdigit;
|
use function ctype_xdigit;
|
||||||
use function hexdec;
|
use function hexdec;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ use Psr\Http\Server\RequestHandlerInterface;
|
|||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
|
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
|
||||||
use Shlinkio\Shlink\Core\Action\Model\QrCodeParams;
|
use Shlinkio\Shlink\Core\Action\Model\QrCodeParams;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\QrCodeOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
||||||
use Shlinkio\Shlink\Core\Options\QrCodeOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifierInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\ShortUrlResolverInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\ShortUrlResolverInterface;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ use GuzzleHttp\Psr7\Response;
|
|||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RobotsOptions;
|
||||||
use Shlinkio\Shlink\Core\Crawling\CrawlingHelperInterface;
|
use Shlinkio\Shlink\Core\Crawling\CrawlingHelperInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\RobotsOptions;
|
|
||||||
|
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
|
|
||||||
28
module/Core/src/Config/Options/DeleteShortUrlsOptions.php
Normal file
28
module/Core/src/Config/Options/DeleteShortUrlsOptions.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
|
||||||
|
use const Shlinkio\Shlink\DEFAULT_DELETE_SHORT_URL_THRESHOLD;
|
||||||
|
|
||||||
|
final readonly class DeleteShortUrlsOptions
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public int $visitsThreshold = DEFAULT_DELETE_SHORT_URL_THRESHOLD,
|
||||||
|
public bool $checkVisitsThreshold = true,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
$threshold = EnvVars::DELETE_SHORT_URL_THRESHOLD->loadFromEnv();
|
||||||
|
|
||||||
|
return new self(
|
||||||
|
visitsThreshold: (int) ($threshold ?? DEFAULT_DELETE_SHORT_URL_THRESHOLD),
|
||||||
|
checkVisitsThreshold: $threshold !== null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,19 +2,29 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirectConfigInterface;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirectConfigInterface;
|
||||||
|
|
||||||
final class NotFoundRedirectOptions implements NotFoundRedirectConfigInterface
|
final readonly class NotFoundRedirectOptions implements NotFoundRedirectConfigInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public readonly ?string $invalidShortUrl = null,
|
public ?string $invalidShortUrl = null,
|
||||||
public readonly ?string $regular404 = null,
|
public ?string $regular404 = null,
|
||||||
public readonly ?string $baseUrl = null,
|
public ?string $baseUrl = null,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
return new self(
|
||||||
|
invalidShortUrl: EnvVars::DEFAULT_INVALID_SHORT_URL_REDIRECT->loadFromEnv(),
|
||||||
|
regular404: EnvVars::DEFAULT_REGULAR_404_REDIRECT->loadFromEnv(),
|
||||||
|
baseUrl: EnvVars::DEFAULT_BASE_URL_REDIRECT->loadFromEnv(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function invalidShortUrlRedirect(): ?string
|
public function invalidShortUrlRedirect(): ?string
|
||||||
{
|
{
|
||||||
return $this->invalidShortUrl;
|
return $this->invalidShortUrl;
|
||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
|
||||||
use const Shlinkio\Shlink\DEFAULT_QR_CODE_BG_COLOR;
|
use const Shlinkio\Shlink\DEFAULT_QR_CODE_BG_COLOR;
|
||||||
use const Shlinkio\Shlink\DEFAULT_QR_CODE_COLOR;
|
use const Shlinkio\Shlink\DEFAULT_QR_CODE_COLOR;
|
||||||
@@ -13,7 +15,7 @@ use const Shlinkio\Shlink\DEFAULT_QR_CODE_MARGIN;
|
|||||||
use const Shlinkio\Shlink\DEFAULT_QR_CODE_ROUND_BLOCK_SIZE;
|
use const Shlinkio\Shlink\DEFAULT_QR_CODE_ROUND_BLOCK_SIZE;
|
||||||
use const Shlinkio\Shlink\DEFAULT_QR_CODE_SIZE;
|
use const Shlinkio\Shlink\DEFAULT_QR_CODE_SIZE;
|
||||||
|
|
||||||
readonly final class QrCodeOptions
|
final readonly class QrCodeOptions
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public int $size = DEFAULT_QR_CODE_SIZE,
|
public int $size = DEFAULT_QR_CODE_SIZE,
|
||||||
@@ -27,4 +29,19 @@ readonly final class QrCodeOptions
|
|||||||
public ?string $logoUrl = null,
|
public ?string $logoUrl = null,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
return new self(
|
||||||
|
size: (int) EnvVars::DEFAULT_QR_CODE_SIZE->loadFromEnv(),
|
||||||
|
margin: (int) EnvVars::DEFAULT_QR_CODE_MARGIN->loadFromEnv(),
|
||||||
|
format: EnvVars::DEFAULT_QR_CODE_FORMAT->loadFromEnv(),
|
||||||
|
errorCorrection: EnvVars::DEFAULT_QR_CODE_ERROR_CORRECTION->loadFromEnv(),
|
||||||
|
roundBlockSize: (bool) EnvVars::DEFAULT_QR_CODE_ROUND_BLOCK_SIZE->loadFromEnv(),
|
||||||
|
enabledForDisabledShortUrls: (bool) EnvVars::QR_CODE_FOR_DISABLED_SHORT_URLS->loadFromEnv(),
|
||||||
|
color: EnvVars::DEFAULT_QR_CODE_COLOR->loadFromEnv(),
|
||||||
|
bgColor: EnvVars::DEFAULT_QR_CODE_BG_COLOR->loadFromEnv(),
|
||||||
|
logoUrl: EnvVars::DEFAULT_QR_CODE_LOGO_URL->loadFromEnv(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
19
module/Core/src/Config/Options/RabbitMqOptions.php
Normal file
19
module/Core/src/Config/Options/RabbitMqOptions.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
|
||||||
|
final readonly class RabbitMqOptions
|
||||||
|
{
|
||||||
|
public function __construct(public bool $enabled = false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
return new self((bool) EnvVars::RABBITMQ_ENABLED->loadFromEnv());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,18 +2,19 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
use Fig\Http\Message\StatusCodeInterface;
|
use Fig\Http\Message\StatusCodeInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
use Shlinkio\Shlink\Core\Util\RedirectStatus;
|
use Shlinkio\Shlink\Core\Util\RedirectStatus;
|
||||||
|
|
||||||
use const Shlinkio\Shlink\DEFAULT_REDIRECT_CACHE_LIFETIME;
|
use const Shlinkio\Shlink\DEFAULT_REDIRECT_CACHE_LIFETIME;
|
||||||
use const Shlinkio\Shlink\DEFAULT_REDIRECT_STATUS_CODE;
|
use const Shlinkio\Shlink\DEFAULT_REDIRECT_STATUS_CODE;
|
||||||
|
|
||||||
final class RedirectOptions
|
final readonly class RedirectOptions
|
||||||
{
|
{
|
||||||
public readonly RedirectStatus $redirectStatusCode;
|
public RedirectStatus $redirectStatusCode;
|
||||||
public readonly int $redirectCacheLifetime;
|
public int $redirectCacheLifetime;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
int $redirectStatusCode = StatusCodeInterface::STATUS_FOUND,
|
int $redirectStatusCode = StatusCodeInterface::STATUS_FOUND,
|
||||||
@@ -24,4 +25,12 @@ final class RedirectOptions
|
|||||||
? $redirectCacheLifetime
|
? $redirectCacheLifetime
|
||||||
: DEFAULT_REDIRECT_CACHE_LIFETIME;
|
: DEFAULT_REDIRECT_CACHE_LIFETIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
return new self(
|
||||||
|
redirectStatusCode: (int) EnvVars::REDIRECT_STATUS_CODE->loadFromEnv(),
|
||||||
|
redirectCacheLifetime: (int) EnvVars::REDIRECT_CACHE_LIFETIME->loadFromEnv(),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
33
module/Core/src/Config/Options/RobotsOptions.php
Normal file
33
module/Core/src/Config/Options/RobotsOptions.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
|
||||||
|
use function count;
|
||||||
|
use function Shlinkio\Shlink\Core\splitByComma;
|
||||||
|
|
||||||
|
final readonly class RobotsOptions
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string[] $userAgents
|
||||||
|
*/
|
||||||
|
public function __construct(public bool $allowAllShortUrls = false, public array $userAgents = [])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
return new self(
|
||||||
|
allowAllShortUrls: (bool) EnvVars::ROBOTS_ALLOW_ALL_SHORT_URLS->loadFromEnv(),
|
||||||
|
userAgents: splitByComma(EnvVars::ROBOTS_USER_AGENTS->loadFromEnv()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasUserAgents(): bool
|
||||||
|
{
|
||||||
|
return count($this->userAgents) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
62
module/Core/src/Config/Options/TrackingOptions.php
Normal file
62
module/Core/src/Config/Options/TrackingOptions.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
|
||||||
|
use function array_key_exists;
|
||||||
|
use function Shlinkio\Shlink\Core\splitByComma;
|
||||||
|
|
||||||
|
final readonly class TrackingOptions
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string[] $disableTrackingFrom
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
// Tells if IP addresses should be anonymized before persisting, to fulfil data protection regulations.
|
||||||
|
// This applies only if IP address tracking is enabled
|
||||||
|
public bool $anonymizeRemoteAddr = true,
|
||||||
|
// Tells if visits to not-found URLs should be tracked. The disableTracking option takes precedence
|
||||||
|
public bool $trackOrphanVisits = true,
|
||||||
|
// A query param that, if provided, will disable tracking of one particular visit. Always takes precedence over
|
||||||
|
// other options
|
||||||
|
public ?string $disableTrackParam = null,
|
||||||
|
// If true, visits will not be tracked at all
|
||||||
|
public bool $disableTracking = false,
|
||||||
|
// If true, visits will be tracked, but neither the IP address, nor the location will be resolved
|
||||||
|
public bool $disableIpTracking = false,
|
||||||
|
// If true, the referrers will not be tracked
|
||||||
|
public bool $disableReferrerTracking = false,
|
||||||
|
// If true, the user agent will not be tracked
|
||||||
|
public bool $disableUaTracking = false,
|
||||||
|
// A list of IP addresses, patterns or CIDR blocks from which tracking is disabled by default
|
||||||
|
public array $disableTrackingFrom = [],
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
return new self(
|
||||||
|
anonymizeRemoteAddr: (bool) EnvVars::ANONYMIZE_REMOTE_ADDR->loadFromEnv(),
|
||||||
|
trackOrphanVisits: (bool) EnvVars::TRACK_ORPHAN_VISITS->loadFromEnv(),
|
||||||
|
disableTrackParam: EnvVars::DISABLE_TRACK_PARAM->loadFromEnv(),
|
||||||
|
disableTracking: (bool) EnvVars::DISABLE_TRACKING->loadFromEnv(),
|
||||||
|
disableIpTracking: (bool) EnvVars::DISABLE_IP_TRACKING->loadFromEnv(),
|
||||||
|
disableReferrerTracking: (bool) EnvVars::DISABLE_REFERRER_TRACKING->loadFromEnv(),
|
||||||
|
disableUaTracking: (bool) EnvVars::DISABLE_UA_TRACKING->loadFromEnv(),
|
||||||
|
disableTrackingFrom: splitByComma(EnvVars::DISABLE_TRACKING_FROM->loadFromEnv()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasDisableTrackingFrom(): bool
|
||||||
|
{
|
||||||
|
return ! empty($this->disableTrackingFrom);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function queryHasDisableTrackParam(array $query): bool
|
||||||
|
{
|
||||||
|
return $this->disableTrackParam !== null && array_key_exists($this->disableTrackParam, $query);
|
||||||
|
}
|
||||||
|
}
|
||||||
62
module/Core/src/Config/Options/UrlShortenerOptions.php
Normal file
62
module/Core/src/Config/Options/UrlShortenerOptions.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Shlinkio\Shlink\Core\Config\Options;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
||||||
|
|
||||||
|
use function max;
|
||||||
|
|
||||||
|
use const Shlinkio\Shlink\DEFAULT_SHORT_CODES_LENGTH;
|
||||||
|
use const Shlinkio\Shlink\MIN_SHORT_CODES_LENGTH;
|
||||||
|
|
||||||
|
final readonly class UrlShortenerOptions
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param array{schema: ?string, hostname: ?string} $domain
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
public array $domain = ['schema' => null, 'hostname' => null],
|
||||||
|
public int $defaultShortCodesLength = DEFAULT_SHORT_CODES_LENGTH,
|
||||||
|
public bool $autoResolveTitles = false,
|
||||||
|
public bool $appendExtraPath = false,
|
||||||
|
public bool $multiSegmentSlugsEnabled = false,
|
||||||
|
public bool $trailingSlashEnabled = false,
|
||||||
|
public ShortUrlMode $mode = ShortUrlMode::STRICT,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
$shortCodesLength = max(
|
||||||
|
(int) EnvVars::DEFAULT_SHORT_CODES_LENGTH->loadFromEnv(),
|
||||||
|
MIN_SHORT_CODES_LENGTH,
|
||||||
|
);
|
||||||
|
$mode = EnvVars::SHORT_URL_MODE->loadFromEnv();
|
||||||
|
|
||||||
|
return new self(
|
||||||
|
domain: [
|
||||||
|
'schema' => ((bool) EnvVars::IS_HTTPS_ENABLED->loadFromEnv()) ? 'https' : 'http',
|
||||||
|
'hostname' => EnvVars::DEFAULT_DOMAIN->loadFromEnv(),
|
||||||
|
],
|
||||||
|
defaultShortCodesLength: $shortCodesLength,
|
||||||
|
autoResolveTitles: (bool) EnvVars::AUTO_RESOLVE_TITLES->loadFromEnv(),
|
||||||
|
appendExtraPath: (bool) EnvVars::REDIRECT_APPEND_EXTRA_PATH->loadFromEnv(),
|
||||||
|
multiSegmentSlugsEnabled: (bool) EnvVars::MULTI_SEGMENT_SLUGS_ENABLED->loadFromEnv(),
|
||||||
|
trailingSlashEnabled: (bool) EnvVars::SHORT_URL_TRAILING_SLASH->loadFromEnv(),
|
||||||
|
mode: ShortUrlMode::tryFrom($mode) ?? ShortUrlMode::STRICT,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isLooseMode(): bool
|
||||||
|
{
|
||||||
|
return $this->mode === ShortUrlMode::LOOSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function defaultDomain(): string
|
||||||
|
{
|
||||||
|
return $this->domain['hostname'] ?? '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,15 +9,15 @@ use Psr\Http\Message\ServerRequestInterface;
|
|||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
use Psr\Http\Server\MiddlewareInterface;
|
use Psr\Http\Server\MiddlewareInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirectResolverInterface;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirectResolverInterface;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
||||||
use Shlinkio\Shlink\Core\Options;
|
|
||||||
|
|
||||||
class NotFoundRedirectHandler implements MiddlewareInterface
|
readonly class NotFoundRedirectHandler implements MiddlewareInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Options\NotFoundRedirectOptions $redirectOptions,
|
private Config\Options\NotFoundRedirectOptions $redirectOptions,
|
||||||
private NotFoundRedirectResolverInterface $redirectResolver,
|
private NotFoundRedirectResolverInterface $redirectResolver,
|
||||||
private DomainServiceInterface $domainService,
|
private DomainServiceInterface $domainService,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\EventDispatcher\Helper;
|
namespace Shlinkio\Shlink\Core\EventDispatcher\Helper;
|
||||||
|
|
||||||
use Shlinkio\Shlink\Common\Mercure\MercureOptions;
|
use Shlinkio\Shlink\Common\Mercure\MercureOptions;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RabbitMqOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher;
|
use Shlinkio\Shlink\Core\EventDispatcher;
|
||||||
use Shlinkio\Shlink\Core\Matomo\MatomoOptions;
|
use Shlinkio\Shlink\Core\Matomo\MatomoOptions;
|
||||||
use Shlinkio\Shlink\Core\Options\RabbitMqOptions;
|
|
||||||
use Shlinkio\Shlink\EventDispatcher\Listener\EnabledListenerCheckerInterface;
|
use Shlinkio\Shlink\EventDispatcher\Listener\EnabledListenerCheckerInterface;
|
||||||
use Shlinkio\Shlink\IpGeolocation\GeoLite2\GeoLite2Options;
|
use Shlinkio\Shlink\IpGeolocation\GeoLite2\GeoLite2Options;
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ namespace Shlinkio\Shlink\Core\EventDispatcher\RabbitMq;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RabbitMqOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Async\AbstractNotifyNewShortUrlListener;
|
use Shlinkio\Shlink\Core\EventDispatcher\Async\AbstractNotifyNewShortUrlListener;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Async\RemoteSystem;
|
use Shlinkio\Shlink\Core\EventDispatcher\Async\RemoteSystem;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\RabbitMqOptions;
|
|
||||||
|
|
||||||
class NotifyNewShortUrlToRabbitMq extends AbstractNotifyNewShortUrlListener
|
class NotifyNewShortUrlToRabbitMq extends AbstractNotifyNewShortUrlListener
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ namespace Shlinkio\Shlink\Core\EventDispatcher\RabbitMq;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RabbitMqOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Async\AbstractNotifyVisitListener;
|
use Shlinkio\Shlink\Core\EventDispatcher\Async\AbstractNotifyVisitListener;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Async\RemoteSystem;
|
use Shlinkio\Shlink\Core\EventDispatcher\Async\RemoteSystem;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\RabbitMqOptions;
|
|
||||||
|
|
||||||
class NotifyVisitToRabbitMq extends AbstractNotifyVisitListener
|
class NotifyVisitToRabbitMq extends AbstractNotifyVisitListener
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,17 +4,31 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Matomo;
|
namespace Shlinkio\Shlink\Core\Matomo;
|
||||||
|
|
||||||
class MatomoOptions
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
|
||||||
|
final readonly class MatomoOptions
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @param numeric-string|int|null $siteId
|
||||||
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public readonly bool $enabled = false,
|
public bool $enabled = false,
|
||||||
public readonly ?string $baseUrl = null,
|
public ?string $baseUrl = null,
|
||||||
/** @var numeric-string|int|null */
|
private string|int|null $siteId = null,
|
||||||
private readonly string|int|null $siteId = null,
|
public ?string $apiToken = null,
|
||||||
public readonly ?string $apiToken = null,
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function fromEnv(): self
|
||||||
|
{
|
||||||
|
return new self(
|
||||||
|
enabled: (bool) EnvVars::MATOMO_ENABLED->loadFromEnv(),
|
||||||
|
baseUrl: EnvVars::MATOMO_BASE_URL->loadFromEnv(),
|
||||||
|
siteId: EnvVars::MATOMO_SITE_ID->loadFromEnv(),
|
||||||
|
apiToken: EnvVars::MATOMO_API_TOKEN->loadFromEnv(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function siteId(): ?int
|
public function siteId(): ?int
|
||||||
{
|
{
|
||||||
if ($this->siteId === null) {
|
if ($this->siteId === null) {
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
|
||||||
|
|
||||||
use const Shlinkio\Shlink\DEFAULT_DELETE_SHORT_URL_THRESHOLD;
|
|
||||||
|
|
||||||
final class DeleteShortUrlsOptions
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public readonly int $visitsThreshold = DEFAULT_DELETE_SHORT_URL_THRESHOLD,
|
|
||||||
public readonly bool $checkVisitsThreshold = true,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
|
||||||
|
|
||||||
final readonly class RabbitMqOptions
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public bool $enabled = false,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
|
||||||
|
|
||||||
use function count;
|
|
||||||
|
|
||||||
final readonly class RobotsOptions
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public bool $allowAllShortUrls = false,
|
|
||||||
/** @var string[] */
|
|
||||||
public array $userAgents = [],
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function hasUserAgents(): bool
|
|
||||||
{
|
|
||||||
return count($this->userAgents) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
|
||||||
|
|
||||||
use function array_key_exists;
|
|
||||||
|
|
||||||
final class TrackingOptions
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public readonly bool $anonymizeRemoteAddr = true,
|
|
||||||
public readonly bool $trackOrphanVisits = true,
|
|
||||||
public readonly ?string $disableTrackParam = null,
|
|
||||||
public readonly bool $disableTracking = false,
|
|
||||||
public readonly bool $disableIpTracking = false,
|
|
||||||
public readonly bool $disableReferrerTracking = false,
|
|
||||||
public readonly bool $disableUaTracking = false,
|
|
||||||
/** @var string[] */
|
|
||||||
public readonly array $disableTrackingFrom = [],
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function hasDisableTrackingFrom(): bool
|
|
||||||
{
|
|
||||||
return ! empty($this->disableTrackingFrom);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function queryHasDisableTrackParam(array $query): bool
|
|
||||||
{
|
|
||||||
return $this->disableTrackParam !== null && array_key_exists($this->disableTrackParam, $query);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Shlinkio\Shlink\Core\Options;
|
|
||||||
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
|
||||||
|
|
||||||
use const Shlinkio\Shlink\DEFAULT_SHORT_CODES_LENGTH;
|
|
||||||
|
|
||||||
final class UrlShortenerOptions
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @param array{schema: ?string, hostname: ?string} $domain
|
|
||||||
*/
|
|
||||||
public function __construct(
|
|
||||||
public readonly array $domain = ['schema' => null, 'hostname' => null],
|
|
||||||
public readonly int $defaultShortCodesLength = DEFAULT_SHORT_CODES_LENGTH,
|
|
||||||
public readonly bool $autoResolveTitles = false,
|
|
||||||
public readonly bool $appendExtraPath = false,
|
|
||||||
public readonly bool $multiSegmentSlugsEnabled = false,
|
|
||||||
public readonly bool $trailingSlashEnabled = false,
|
|
||||||
public readonly ShortUrlMode $mode = ShortUrlMode::STRICT,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isLooseMode(): bool
|
|
||||||
{
|
|
||||||
return $this->mode === ShortUrlMode::LOOSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function defaultDomain(): string
|
|
||||||
{
|
|
||||||
return $this->domain['hostname'] ?? '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\ShortUrl;
|
namespace Shlinkio\Shlink\Core\ShortUrl;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\DeleteShortUrlsOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception;
|
use Shlinkio\Shlink\Core\Exception;
|
||||||
use Shlinkio\Shlink\Core\Options\DeleteShortUrlsOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ExpiredShortUrlsConditions;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ExpiredShortUrlsConditions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\ShortUrl\Helper;
|
namespace Shlinkio\Shlink\Core\ShortUrl\Helper;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlRepository;
|
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlRepository;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use GuzzleHttp\Psr7\Query;
|
|||||||
use GuzzleHttp\Psr7\Uri;
|
use GuzzleHttp\Psr7\Uri;
|
||||||
use Laminas\Stdlib\ArrayUtils;
|
use Laminas\Stdlib\ArrayUtils;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\Core\RedirectRule\ShortUrlRedirectionResolverInterface;
|
use Shlinkio\Shlink\Core\RedirectRule\ShortUrlRedirectionResolverInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Fig\Http\Message\RequestMethodInterface;
|
|||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\RequestOptions;
|
use GuzzleHttp\RequestOptions;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
use function html_entity_decode;
|
use function html_entity_decode;
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ use Psr\Http\Message\ServerRequestInterface;
|
|||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
use Psr\Http\Server\MiddlewareInterface;
|
use Psr\Http\Server\MiddlewareInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
||||||
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlRedirectionBuilderInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlRedirectionBuilderInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\ShortUrlResolverInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\ShortUrlResolverInterface;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Psr\Http\Message\ResponseInterface;
|
|||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\MiddlewareInterface;
|
use Psr\Http\Server\MiddlewareInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
|
|
||||||
use function rtrim;
|
use function rtrim;
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\ShortUrl\Model;
|
namespace Shlinkio\Shlink\Core\ShortUrl\Model;
|
||||||
|
|
||||||
use Cake\Chronos\Chronos;
|
use Cake\Chronos\Chronos;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\TitleResolutionModelInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\TitleResolutionModelInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\ShortUrlInputFilter;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\ShortUrlInputFilter;
|
||||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\ShortUrl\Model\Validation;
|
namespace Shlinkio\Shlink\Core\ShortUrl\Model\Validation;
|
||||||
|
|
||||||
use Laminas\Filter\FilterInterface;
|
use Laminas\Filter\FilterInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
|
|
||||||
use function is_string;
|
use function is_string;
|
||||||
use function str_replace;
|
use function str_replace;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\ShortUrl\Model\Validation;
|
namespace Shlinkio\Shlink\Core\ShortUrl\Model\Validation;
|
||||||
|
|
||||||
use Laminas\Validator\AbstractValidator;
|
use Laminas\Validator\AbstractValidator;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
|
|
||||||
use function is_string;
|
use function is_string;
|
||||||
use function strpbrk;
|
use function strpbrk;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use Laminas\InputFilter\InputFilter;
|
|||||||
use Laminas\Validator;
|
use Laminas\Validator;
|
||||||
use Shlinkio\Shlink\Common\Validation\HostAndPortValidator;
|
use Shlinkio\Shlink\Common\Validation\HostAndPortValidator;
|
||||||
use Shlinkio\Shlink\Common\Validation\InputFactory;
|
use Shlinkio\Shlink\Common\Validation\InputFactory;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||||
|
|
||||||
use function is_string;
|
use function is_string;
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ use Doctrine\Common\Collections;
|
|||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Events;
|
use Doctrine\ORM\Events;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\Tag\Entity\Tag;
|
use Shlinkio\Shlink\Core\Tag\Entity\Tag;
|
||||||
use Symfony\Component\Lock\Lock;
|
use Symfony\Component\Lock\Lock;
|
||||||
use Symfony\Component\Lock\LockFactory;
|
use Symfony\Component\Lock\LockFactory;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\ShortUrl;
|
namespace Shlinkio\Shlink\Core\ShortUrl;
|
||||||
|
|
||||||
use Shlinkio\Shlink\Common\Paginator\Paginator;
|
use Shlinkio\Shlink\Common\Paginator\Paginator;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlsParams;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlsParams;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Paginator\Adapter\ShortUrlRepositoryAdapter;
|
use Shlinkio\Shlink\Core\ShortUrl\Paginator\Adapter\ShortUrlRepositoryAdapter;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlListRepositoryInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlListRepositoryInterface;
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\ShortUrl;
|
namespace Shlinkio\Shlink\Core\ShortUrl;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlRepository;
|
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlRepository;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace Shlinkio\Shlink\Core\Util;
|
|||||||
|
|
||||||
use Laminas\Diactoros\Response\RedirectResponse;
|
use Laminas\Diactoros\Response\RedirectResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\RedirectOptions;
|
use Shlinkio\Shlink\Core\Config\Options\RedirectOptions;
|
||||||
|
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Shlinkio\Shlink\Core\Visit\Model;
|
namespace Shlinkio\Shlink\Core\Visit\Model;
|
||||||
|
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
|
|
||||||
use function Shlinkio\Shlink\Core\ipAddressFromRequest;
|
use function Shlinkio\Shlink\Core\ipAddressFromRequest;
|
||||||
use function Shlinkio\Shlink\Core\isCrawler;
|
use function Shlinkio\Shlink\Core\isCrawler;
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ namespace Shlinkio\Shlink\Core\Visit;
|
|||||||
use Fig\Http\Message\RequestMethodInterface;
|
use Fig\Http\Message\RequestMethodInterface;
|
||||||
use Mezzio\Router\Middleware\ImplicitHeadMiddleware;
|
use Mezzio\Router\Middleware\ImplicitHeadMiddleware;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
||||||
use Shlinkio\Shlink\Core\Exception\InvalidIpFormatException;
|
use Shlinkio\Shlink\Core\Exception\InvalidIpFormatException;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\Util\IpAddressUtils;
|
use Shlinkio\Shlink\Core\Util\IpAddressUtils;
|
||||||
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ namespace Shlinkio\Shlink\Core\Visit;
|
|||||||
|
|
||||||
use Doctrine\ORM;
|
use Doctrine\ORM;
|
||||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Event\UrlVisited;
|
use Shlinkio\Shlink\Core\EventDispatcher\Event\UrlVisited;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\Visit\Entity\Visit;
|
use Shlinkio\Shlink\Core\Visit\Entity\Visit;
|
||||||
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ use Psr\Http\Server\RequestHandlerInterface;
|
|||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
|
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
|
||||||
use Shlinkio\Shlink\Core\Action\QrCodeAction;
|
use Shlinkio\Shlink\Core\Action\QrCodeAction;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\QrCodeOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
||||||
use Shlinkio\Shlink\Core\Options\QrCodeOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlStringifier;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ use PHPUnit\Framework\Attributes\Test;
|
|||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Action\RobotsAction;
|
use Shlinkio\Shlink\Core\Action\RobotsAction;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RobotsOptions;
|
||||||
use Shlinkio\Shlink\Core\Crawling\CrawlingHelperInterface;
|
use Shlinkio\Shlink\Core\Crawling\CrawlingHelperInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\RobotsOptions;
|
|
||||||
|
|
||||||
class RobotsActionTest extends TestCase
|
class RobotsActionTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ use Psr\Http\Message\UriInterface;
|
|||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
use Shlinkio\Shlink\Core\Action\RedirectAction;
|
use Shlinkio\Shlink\Core\Action\RedirectAction;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirectResolver;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirectResolver;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
|
||||||
use Shlinkio\Shlink\Core\Util\RedirectResponseHelperInterface;
|
use Shlinkio\Shlink\Core\Util\RedirectResponseHelperInterface;
|
||||||
|
|
||||||
use function Laminas\Stratigility\middleware;
|
use function Laminas\Stratigility\middleware;
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ use Psr\Http\Message\ServerRequestInterface;
|
|||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirectResolverInterface;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirectResolverInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
||||||
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\NotFoundRedirectHandler;
|
use Shlinkio\Shlink\Core\ErrorHandler\NotFoundRedirectHandler;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
|
||||||
|
|
||||||
class NotFoundRedirectHandlerTest extends TestCase
|
class NotFoundRedirectHandlerTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Common\Mercure\MercureOptions;
|
use Shlinkio\Shlink\Common\Mercure\MercureOptions;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RabbitMqOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Helper\EnabledListenerChecker;
|
use Shlinkio\Shlink\Core\EventDispatcher\Helper\EnabledListenerChecker;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Matomo\SendVisitToMatomo;
|
use Shlinkio\Shlink\Core\EventDispatcher\Matomo\SendVisitToMatomo;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Mercure\NotifyNewShortUrlToMercure;
|
use Shlinkio\Shlink\Core\EventDispatcher\Mercure\NotifyNewShortUrlToMercure;
|
||||||
@@ -18,7 +19,6 @@ use Shlinkio\Shlink\Core\EventDispatcher\RedisPubSub\NotifyNewShortUrlToRedis;
|
|||||||
use Shlinkio\Shlink\Core\EventDispatcher\RedisPubSub\NotifyVisitToRedis;
|
use Shlinkio\Shlink\Core\EventDispatcher\RedisPubSub\NotifyVisitToRedis;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\UpdateGeoLiteDb;
|
use Shlinkio\Shlink\Core\EventDispatcher\UpdateGeoLiteDb;
|
||||||
use Shlinkio\Shlink\Core\Matomo\MatomoOptions;
|
use Shlinkio\Shlink\Core\Matomo\MatomoOptions;
|
||||||
use Shlinkio\Shlink\Core\Options\RabbitMqOptions;
|
|
||||||
use Shlinkio\Shlink\IpGeolocation\GeoLite2\GeoLite2Options;
|
use Shlinkio\Shlink\IpGeolocation\GeoLite2\GeoLite2Options;
|
||||||
|
|
||||||
class EnabledListenerCheckerTest extends TestCase
|
class EnabledListenerCheckerTest extends TestCase
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ use Psr\Log\LoggerInterface;
|
|||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
||||||
use Shlinkio\Shlink\Common\UpdatePublishing\Update;
|
use Shlinkio\Shlink\Common\UpdatePublishing\Update;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RabbitMqOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Event\ShortUrlCreated;
|
use Shlinkio\Shlink\Core\EventDispatcher\Event\ShortUrlCreated;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq;
|
use Shlinkio\Shlink\Core\EventDispatcher\RabbitMq\NotifyNewShortUrlToRabbitMq;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Topic;
|
use Shlinkio\Shlink\Core\EventDispatcher\Topic;
|
||||||
use Shlinkio\Shlink\Core\Options\RabbitMqOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ use Psr\Log\LoggerInterface;
|
|||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
use Shlinkio\Shlink\Common\UpdatePublishing\PublishingHelperInterface;
|
||||||
use Shlinkio\Shlink\Common\UpdatePublishing\Update;
|
use Shlinkio\Shlink\Common\UpdatePublishing\Update;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\RabbitMqOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Event\VisitLocated;
|
use Shlinkio\Shlink\Core\EventDispatcher\Event\VisitLocated;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
use Shlinkio\Shlink\Core\EventDispatcher\PublishingUpdatesGeneratorInterface;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\RabbitMq\NotifyVisitToRabbitMq;
|
use Shlinkio\Shlink\Core\EventDispatcher\RabbitMq\NotifyVisitToRabbitMq;
|
||||||
use Shlinkio\Shlink\Core\Options\RabbitMqOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\Visit\Entity\Visit;
|
use Shlinkio\Shlink\Core\Visit\Entity\Visit;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\DeleteShortUrlsOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\DeleteShortUrlException;
|
use Shlinkio\Shlink\Core\Exception\DeleteShortUrlException;
|
||||||
use Shlinkio\Shlink\Core\Options\DeleteShortUrlsOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\DeleteShortUrlService;
|
use Shlinkio\Shlink\Core\ShortUrl\DeleteShortUrlService;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ExpiredShortUrlsConditions;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ExpiredShortUrlsConditions;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\Attributes\TestWith;
|
use PHPUnit\Framework\Attributes\TestWith;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ShortCodeCannotBeRegeneratedException;
|
use Shlinkio\Shlink\Core\Exception\ShortCodeCannotBeRegeneratedException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortCodeUniquenessHelper;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortCodeUniquenessHelper;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use PHPUnit\Framework\Attributes\TestWith;
|
|||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\Core\RedirectRule\ShortUrlRedirectionResolverInterface;
|
use Shlinkio\Shlink\Core\RedirectRule\ShortUrlRedirectionResolverInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlRedirectionBuilder;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlRedirectionBuilder;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use PHPUnit\Framework\Attributes\TestWith;
|
|||||||
use PHPUnit\Framework\MockObject\Builder\InvocationMocker;
|
use PHPUnit\Framework\MockObject\Builder\InvocationMocker;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlTitleResolutionHelper;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlTitleResolutionHelper;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ use PHPUnit\Framework\TestCase;
|
|||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Shlinkio\Shlink\Core\Action\RedirectAction;
|
use Shlinkio\Shlink\Core\Action\RedirectAction;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
||||||
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlRedirectionBuilderInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlRedirectionBuilderInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Middleware\ExtraPathRedirectMiddleware;
|
use Shlinkio\Shlink\Core\ShortUrl\Middleware\ExtraPathRedirectMiddleware;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use PHPUnit\Framework\MockObject\MockObject;
|
|||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Middleware\TrimTrailingSlashMiddleware;
|
use Shlinkio\Shlink\Core\ShortUrl\Middleware\TrimTrailingSlashMiddleware;
|
||||||
|
|
||||||
class TrimTrailingSlashMiddlewareTest extends TestCase
|
class TrimTrailingSlashMiddlewareTest extends TestCase
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ use Cake\Chronos\Chronos;
|
|||||||
use PHPUnit\Framework\Attributes\DataProvider;
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlMode;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\ShortUrlInputFilter;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\ShortUrlInputFilter;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace ShlinkioTest\Shlink\Core\ShortUrl\Model\Validation;
|
|||||||
use PHPUnit\Framework\Attributes\DataProvider;
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\CustomSlugValidator;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\Validation\CustomSlugValidator;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
||||||
use Shlinkio\Shlink\Core\Domain\Repository\DomainRepository;
|
use Shlinkio\Shlink\Core\Domain\Repository\DomainRepository;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Resolver\PersistenceShortUrlRelationResolver;
|
use Shlinkio\Shlink\Core\ShortUrl\Resolver\PersistenceShortUrlRelationResolver;
|
||||||
use Shlinkio\Shlink\Core\Tag\Entity\Tag;
|
use Shlinkio\Shlink\Core\Tag\Entity\Tag;
|
||||||
use Shlinkio\Shlink\Core\Tag\Repository\TagRepository;
|
use Shlinkio\Shlink\Core\Tag\Repository\TagRepository;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use PHPUnit\Framework\Attributes\DataProviderExternal;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlsParams;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlsParams;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlListRepositoryInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Repository\ShortUrlListRepositoryInterface;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ use PHPUnit\Framework\Attributes\DataProviderExternal;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlIdentifier;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Laminas\Diactoros\Response\RedirectResponse;
|
|||||||
use PHPUnit\Framework\Attributes\DataProvider;
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Options\RedirectOptions;
|
use Shlinkio\Shlink\Core\Config\Options\RedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\Util\RedirectResponseHelper;
|
use Shlinkio\Shlink\Core\Util\RedirectResponseHelper;
|
||||||
|
|
||||||
class RedirectResponseHelperTest extends TestCase
|
class RedirectResponseHelperTest extends TestCase
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace ShlinkioTest\Shlink\Core\Visit\Model;
|
|||||||
use PHPUnit\Framework\Attributes\DataProvider;
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
||||||
|
|
||||||
use function random_int;
|
use function random_int;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ use PHPUnit\Framework\MockObject\MockObject;
|
|||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Shlinkio\Shlink\Common\Middleware\IpAddressMiddlewareFactory;
|
use Shlinkio\Shlink\Common\Middleware\IpAddressMiddlewareFactory;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
use Shlinkio\Shlink\Core\ErrorHandler\Model\NotFoundType;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
||||||
use Shlinkio\Shlink\Core\Visit\RequestTracker;
|
use Shlinkio\Shlink\Core\Visit\RequestTracker;
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ use PHPUnit\Framework\Attributes\Test;
|
|||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\TrackingOptions;
|
||||||
use Shlinkio\Shlink\Core\EventDispatcher\Event\UrlVisited;
|
use Shlinkio\Shlink\Core\EventDispatcher\Event\UrlVisited;
|
||||||
use Shlinkio\Shlink\Core\Options\TrackingOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\Visit\Entity\Visit;
|
use Shlinkio\Shlink\Core\Visit\Entity\Visit;
|
||||||
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
use Shlinkio\Shlink\Core\Visit\Model\Visitor;
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ use Mezzio\ProblemDetails\ProblemDetailsResponseFactory;
|
|||||||
use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
|
use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
|
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
|
||||||
|
use Shlinkio\Shlink\Core\Config;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainService;
|
use Shlinkio\Shlink\Core\Domain\DomainService;
|
||||||
use Shlinkio\Shlink\Core\Options;
|
|
||||||
use Shlinkio\Shlink\Core\RedirectRule;
|
use Shlinkio\Shlink\Core\RedirectRule;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Transformer\ShortUrlDataTransformer;
|
use Shlinkio\Shlink\Core\ShortUrl\Transformer\ShortUrlDataTransformer;
|
||||||
@@ -64,17 +64,17 @@ return [
|
|||||||
ConfigAbstractFactory::class => [
|
ConfigAbstractFactory::class => [
|
||||||
ApiKeyService::class => ['em'],
|
ApiKeyService::class => ['em'],
|
||||||
|
|
||||||
Action\HealthAction::class => ['em', Options\AppOptions::class],
|
Action\HealthAction::class => ['em', Config\Options\AppOptions::class],
|
||||||
Action\MercureInfoAction::class => [LcobucciJwtProvider::class, 'config.mercure'],
|
Action\MercureInfoAction::class => [LcobucciJwtProvider::class, 'config.mercure'],
|
||||||
Action\ShortUrl\CreateShortUrlAction::class => [
|
Action\ShortUrl\CreateShortUrlAction::class => [
|
||||||
ShortUrl\UrlShortener::class,
|
ShortUrl\UrlShortener::class,
|
||||||
ShortUrlDataTransformer::class,
|
ShortUrlDataTransformer::class,
|
||||||
Options\UrlShortenerOptions::class,
|
Config\Options\UrlShortenerOptions::class,
|
||||||
],
|
],
|
||||||
Action\ShortUrl\SingleStepCreateShortUrlAction::class => [
|
Action\ShortUrl\SingleStepCreateShortUrlAction::class => [
|
||||||
ShortUrl\UrlShortener::class,
|
ShortUrl\UrlShortener::class,
|
||||||
ShortUrlDataTransformer::class,
|
ShortUrlDataTransformer::class,
|
||||||
Options\UrlShortenerOptions::class,
|
Config\Options\UrlShortenerOptions::class,
|
||||||
],
|
],
|
||||||
Action\ShortUrl\EditShortUrlAction::class => [ShortUrl\ShortUrlService::class, ShortUrlDataTransformer::class],
|
Action\ShortUrl\EditShortUrlAction::class => [ShortUrl\ShortUrlService::class, ShortUrlDataTransformer::class],
|
||||||
Action\ShortUrl\DeleteShortUrlAction::class => [ShortUrl\DeleteShortUrlService::class],
|
Action\ShortUrl\DeleteShortUrlAction::class => [ShortUrl\DeleteShortUrlService::class],
|
||||||
@@ -101,7 +101,7 @@ return [
|
|||||||
Action\Tag\TagsStatsAction::class => [TagService::class],
|
Action\Tag\TagsStatsAction::class => [TagService::class],
|
||||||
Action\Tag\DeleteTagsAction::class => [TagService::class],
|
Action\Tag\DeleteTagsAction::class => [TagService::class],
|
||||||
Action\Tag\UpdateTagAction::class => [TagService::class],
|
Action\Tag\UpdateTagAction::class => [TagService::class],
|
||||||
Action\Domain\ListDomainsAction::class => [DomainService::class, Options\NotFoundRedirectOptions::class],
|
Action\Domain\ListDomainsAction::class => [DomainService::class, Config\Options\NotFoundRedirectOptions::class],
|
||||||
Action\Domain\DomainRedirectsAction::class => [DomainService::class],
|
Action\Domain\DomainRedirectsAction::class => [DomainService::class],
|
||||||
Action\RedirectRule\ListRedirectRulesAction::class => [
|
Action\RedirectRule\ListRedirectRulesAction::class => [
|
||||||
ShortUrl\ShortUrlResolver::class,
|
ShortUrl\ShortUrlResolver::class,
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ use Laminas\Diactoros\Response\JsonResponse;
|
|||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
|
||||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||||
use Shlinkio\Shlink\Rest\Middleware\AuthenticationMiddleware;
|
use Shlinkio\Shlink\Rest\Middleware\AuthenticationMiddleware;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Shlinkio\Shlink\Core\Options\AppOptions;
|
use Shlinkio\Shlink\Core\Config\Options\AppOptions;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
class HealthAction extends AbstractRestAction
|
class HealthAction extends AbstractRestAction
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl;
|
|||||||
use Laminas\Diactoros\Response\JsonResponse;
|
use Laminas\Diactoros\Response\JsonResponse;
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Transformer\ShortUrlDataTransformerInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\Transformer\ShortUrlDataTransformerInterface;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\UrlShortenerInterface;
|
use Shlinkio\Shlink\Core\ShortUrl\UrlShortenerInterface;
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ use PHPUnit\Framework\Attributes\Test;
|
|||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
use Shlinkio\Shlink\Core\Domain\DomainServiceInterface;
|
||||||
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
||||||
use Shlinkio\Shlink\Core\Domain\Model\DomainItem;
|
use Shlinkio\Shlink\Core\Domain\Model\DomainItem;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
|
||||||
use Shlinkio\Shlink\Rest\Action\Domain\ListDomainsAction;
|
use Shlinkio\Shlink\Rest\Action\Domain\ListDomainsAction;
|
||||||
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
use Shlinkio\Shlink\Rest\Entity\ApiKey;
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirectConfigInterface;
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirectConfigInterface;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\NotFoundRedirectOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
|
||||||
use Shlinkio\Shlink\Rest\Action\Domain\Request\DomainRedirectsRequest;
|
use Shlinkio\Shlink\Rest\Action\Domain\Request\DomainRedirectsRequest;
|
||||||
|
|
||||||
class DomainRedirectsRequestTest extends TestCase
|
class DomainRedirectsRequestTest extends TestCase
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use Laminas\Diactoros\ServerRequest;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Options\AppOptions;
|
use Shlinkio\Shlink\Core\Config\Options\AppOptions;
|
||||||
use Shlinkio\Shlink\Rest\Action\HealthAction;
|
use Shlinkio\Shlink\Rest\Action\HealthAction;
|
||||||
|
|
||||||
class HealthActionTest extends TestCase
|
class HealthActionTest extends TestCase
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ use PHPUnit\Framework\Attributes\DataProvider;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\UrlShorteningResult;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\UrlShorteningResult;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Laminas\Diactoros\ServerRequest;
|
|||||||
use PHPUnit\Framework\Attributes\Test;
|
use PHPUnit\Framework\Attributes\Test;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Shlinkio\Shlink\Core\Options\UrlShortenerOptions;
|
use Shlinkio\Shlink\Core\Config\Options\UrlShortenerOptions;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\ShortUrlCreation;
|
||||||
use Shlinkio\Shlink\Core\ShortUrl\Model\UrlShorteningResult;
|
use Shlinkio\Shlink\Core\ShortUrl\Model\UrlShorteningResult;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user