Code Monkey home page Code Monkey logo

redirect-bundle's People

Contributors

chris53897 avatar emirii avatar gwendolenlynch avatar kbond avatar napestershine avatar sadikoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

redirect-bundle's Issues

4.x ideas

  • Rich models (cannot be created in an invalid state)
  • RedirectDto to be used by the form type (will require a custom unique entity validator until symfony/symfony#38662 is available)
  • Option to use messenger to update Redirect stats
  • Option to use messenger to create/update NotFound
  • NotFound changes
    • split into:
      • SimpleNotFound: single row for each source with count/last accessed
      • AdvancedNotFound: row for every 404 occurrence (same as 3.x)
    • new config options:
      • absolute (false by default): include domain/scheme in source
      • include_query (false by default): include query in source

Extra EntityManager service kills EntityManager autowiring

Hi buddy!

We were just upgrading to the latest version of the bundle, and suddenly our EntityManager couldn't be autowired into any services anymore! The problem is that this bundle introduces a second service, which uses this class: https://github.com/kbond/ZenstruckRedirectBundle/blob/7504b70a46ab663273a1437bbbdbe37091591a65/src/Resources/config/orm.xml#L8

I see that the purpose is to be able to control which entity manager is used. Could this be done in a simpler way with an alias? For example, don't actually create a service called zenstruck_redirect.entity_manager, simply set an alias in the container so that zenstruck_redirect.entity_manager is an alias to the correct entity manager service (e.g. doctrine.orm.default_entity_manager where default changes to be the model_manager_name config). This would avoid needing to add the additional service to the container, which causes the issue.

And to really try to tug at your heart-strings... it's even technically (though barely) more performant! The current method requires an extra call to $container->get('doctrine')->getManager() to get the service, instead of re-using the existing. Ok, this last reason is CRAP, and would save only 1ms every 1000 requests... but I'm just trying to sweeten the deal ;).

Cheers!

allow for hash tags

Since hash tags are not set to the server a controller will be necessary.

Source: if source has multiple variations of the same path in the db, send them all to the controller and use javascript to determine the correct destination

Symfony flex recipe

Hey @kbond, it's me again :)

FYI: You can create your own Symfony Flex recipe so the default configuration is added automatically when installing your bundle via composer

I'll try to get pull some time next week and push a PR, but if you do it before that I won't mind ;)

Installation not working + problem for new and edit redirects

Hi,

I have followed the whole installation (bundle in kernel, creation of the notFound and redirect entities + DB update, default config). My config is:
zenstruck_redirect:
redirect_class: AppBundle\Entity\Redirect
not_found_class: AppBundle\Entity\NotFound
model_manager_name: ~
remove_not_founds: true

As I understand one of my user falls on a 404 error, either the notfound DB will have a new row added to it or the user will be redirected to the right url included in my redirects. It does not do it.

For a new redirect, what is the exact code with parameters?

For an edit, symfony tells me: Could not load type "zenstruck_redirect"
I am unsure of what that means.

Thanks a lot for your time and this awesome bundle!

Thanks

Symfony 5 support

$ composer require zenstruck/redirect-bundle
Using version ^3.3 for zenstruck/redirect-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - zenstruck/redirect-bundle v3.3.2 requires symfony/framework-bundle ^2.8|^3.0|^4.0 -> no matching package found.
    - zenstruck/redirect-bundle v3.3.1 requires symfony/framework-bundle ^2.8|^3.0|^4.0 -> no matching package found.
    - zenstruck/redirect-bundle v3.3.0 requires symfony/framework-bundle ^2.8|^3.0|^4.0 -> no matching package found.
    - Installation request for zenstruck/redirect-bundle ^3.3 -> satisfiable by zenstruck/redirect-bundle[v3.3.0, v3.3.1, v3.3.2].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.

Inheritance Issues - Trying to override model functions

Hello there,
I have a fairly large project and your bundle would fit in great with it, aside from one hiccup. The only issue I have is that I have multiple subdomains in my project. When I try to save a redirect it automatically transforms 'https://suba.domain.com/test' to '/test' even though I would like to control multiple sub domains. The redirect happens on all subdomains instead of this one. I assume multiple subdomain functionality is not built in the project.

There are also some issues with inheritance because the model has all private methods, so overwriting functions is impossible as well.

I was thinking about just forking your bundle and using for my own projects, but would you be interested in a PR for this functionality?

EDIT: I added a PR for the extensible classes:
#27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.