Download the PHP package freeq/redirector without Composer
On this page you can find all versions of the php package freeq/redirector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download freeq/redirector
More information about freeq/redirector
Files in freeq/redirector
Informations about the package redirector
Redirector
Redirect manager
This package provides you with a simple tool to redirect users. You can easily manage everything.
Installation
Via Composer
Using
Use package everywhere you need. The best way to manage your redirections is to run it in Observer or other event listener. You should store redirections after saving to the database, drop them from store after removing database record. Every redirect object should implement Redirectable contract.
Create manager
Make instance of your redirections manager. It allows you to store/delete/flush/get data.
Manage Redirectable object
Store object
Drop it
Flush everything
Start redirection for given route
Classes
Freeq\Redirector\Manager- allows you to manage.Freeq\Redirector\StorageFactory- is creating concrete class depending of passed 'type' to the manager constructor.Freeq\Redirector\Storages\FileStorage- driver which allows you to store redirections as mini files.Freeq\Redirector\Storages\RedisStorage- driver which allows you to store redirections as redis records.
Redirectable methods
Your object which implements Freeq\Redirector\Contracts\Redirectable needs methods:
routeFrom()- which route should be redirected.routeTo()- where did you want to go by your redirection (eg. https://github.com).statusHttp()- redirect using specific http statuses (301 or 302).hash()- hash is string similar to hashed routeFrom() by md5. It's redis key or filename.expireAt()- returns date to expire your redirection.
Contributing
Please see contributing.md for details.
