agence-adeliom/easy-redirect-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

agence-adeliom/easy-redirect-bundle

最新稳定版本:3.0.1

Composer 安装命令:

composer require agence-adeliom/easy-redirect-bundle

包简介

Symfony redirection bundle for EasyAdmin

README 文档

README

Adeliom Quality gate

Easy Redirect Bundle

This bundle adds entities for redirects and 404 errors.

For redirects, 404 errors are intercepted and the requested path is looked up. If a match is found it redirects to the found redirect's destination. The count and last accessed date are updated as well. A redirect form type and validation is available as well.

404 errors can be logged as well. Each 404 error is it's own record in the database. The path, full URL, timestamp, and referer are stored. Storing each error as a separate record allows viewing statistics over time and seeing all the referer URLs. When a redirect is created or updated, 404 records that match it's path are deleted.

Versions

Repository Branch Version Symfony Compatibility PHP Compatibility Status
3.x 3.x 6.4, and 7.x 8.2 or higher New features and bug fixes
2.x 2.x 5.4, and 6.x 8.0.2 or higher Bug fixes
1.x 1.x 4.4, and 5.x 7.2.5 or higher No longer maintained

Installation with Symfony Flex

Add our recipes endpoint

{
  "extra": {
    "symfony": {
      "endpoint": [
        "https://api.github.com/repos/agence-adeliom/symfony-recipes/contents/index.json?ref=flex/main",
        ...
        "flex://defaults"
      ],
      "allow-contrib": true
    }
  }
}

Install with composer

composer require agence-adeliom/easy-redirect-bundle

Setup database

Using doctrine migrations

php bin/console doctrine:migration:diff
php bin/console doctrine:migration:migrate

Without

php bin/console doctrine:schema:update --force

Documentation

Manage redirect in your Easyadmin dashboard

Go to your dashboard controller, example : src/Controller/Admin/DashboardController.php

<?php

namespace App\Controller\Admin;

...
use Adeliom\EasyRedirectBundle\Admin\EasyRedirectTrait;

class DashboardController extends AbstractDashboardController
{
    ...
    use EasyRedirectTrait;

    ...
    public function configureMenuItems(): iterable
    {
        ...
        yield from $this->configRedirectEntry();

        ...

Configuration

# config/packages/easy_redirect.yaml
easy_redirect:
    redirect_class:     ~ # Required and must be an instance of "Adeliom\EasyRedirectBundle\Entity\Redirect"
    not_found_class:    ~ # Required and must be an instance of "Adeliom\EasyRedirectBundle\Entity\NotFound"
    model_manager_name: ~ # If a custom model manager is used by default its 'default'

    # When enabled, when a redirect is updated or created, the NotFound entites with a matching path are removed.
    remove_not_founds: true

License

MIT

Authors

Thanks to

kbond/ZenstruckRedirectBundle

统计信息

  • 总下载量: 7.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-23