This component will shorten a string to a shorter string. Can also expand the shorter string back to the full string.
Install using composer ( https://packagist.org/packages/opus-online/yii-shortify )
At the head of protected/config/main.php add:
Yii::setPathOfAlias('OpusOnline.Shortify', dirname(FILE) . '/../vendors/opus-online/yii-shortify');
Example usage:
$redis = new Predis\Client('tcp://localhost:6379');
$redis->select(15);
$shortify = new \OpusOnline\Shortify\Shortify($redis);
$shorten = $shortify->shorten('route3');
var_dump($shorten);
$expand = $shortify->expand($shorten);
var_dump($expand);
No stable releases.
Comments