21 ms·
Polr – A modern, minimalist, and lightweight URL shortener in PHP
- shaftoe 10y agoI'm always amazed to see minimalist used to describe a dozen placeholder directories and files. That said, the code is clean and modern php.
- cydrobolt 10y agoMinimalist in regards to its design, perhaps not the code structure :) In contrast to other projects such as YOURLS, Polr tries to be minimalist by avoiding heavy graphs or unnecessary bloat.
- asimuvPR 10y agoThe structure is good. You can read what's happening clearly. It also shows what's a laravel idiom and what is modern php. I giggled a bit when reading the user factory code. It feels so enterprise. Not a bad thing in itself. I was just happy to see php code that is not a ball of mud held together by holy water. :)
- eyelidlessness 10y agoI don't know. If something is defined as "lightweight" (their word, but same point applies to "minimalist"), I should not have to blow my entire brain memory stack keeping the filesystem structure in my head just to start to examine how it's done.
- ysleepy 10y agoYes, 4192 files and 32MiB, quite minimal.
- poopsintub 10y ago4 files needed including a dB if you want to show a data table in Html. Maybe 60 lines of code to complete.
- travisty 10y agoSeems 'minimal' and 'modern' are just marketing terms these days. Honestly though, this is the largest and most complex URL shortner that I can ever recall seeing.
- ahoka 10y agoMaybe it's some kind of dadaist minimalism?
- kevin_thibedeau 10y agoWouldn't a minimalist implementation just look up shortened URLs in a map and spit out a redirect to the original URL? Seems like that could be done in a few KiB.
- milankragujevic 10y agoTBH, You can pretty much do a single PHP file, with no dependencies, and without mod_rewrite. Just site.com/?fDS- for example, and it redirects. Storage can be MySQL or some other DB or even a flat file with locking.
- dubcanada 10y agoWhy is the entire vendor directory in github? I'm fairly certain some of those packages cannot be redistributed like that.
- munger 10y agoAgree. What is the point of using composer or any dependency manager if you check-in the vendor folder?
- huuu 10y agoBecause your project is useless when a dependency is removed in the future. It happened to me one time and now I'm really considering to include the vendor folder in my own repository. Of course a dependency manager is still very useful to setup a new project.
- poopsintub 10y agoThat's default GitHub settings. I assume you couldn't easily rebuild the project if you cloned it down as mentioned by another.
- 0xmohit 10y agoURL Shortener in 43 lines of Haskell. http://bitemyapp.com/posts/2014-08-22-url-shortener-in-haskell.html http://bitemyapp.com/posts/2014-08-22-url-shortener-in-haske...
- simple10 10y agoNot to dis Polr, but if performance and minimalism are your thing, there are a lot of nginx + lua + redis URL shorteners on github. Two random'ish selections... https://gist.github.com/MendelGusmao/2356310 https://gist.github.com/MendelGusmao/2356310 https://github.com/sanshi0518/shorturl-nginx https://github.com/sanshi0518/shorturl-nginx
- mrmondo 10y agoGood on you for making it, but I have to side with the comments here that it's not only not lightweight, I personally also can't see what's so modern about it - I'm not hating on PHP but even as a language that's an old beast.
- wineisfine 10y agoNice that's it's in php/MySQL so it works anywhere.
- mrzool 10y agoSerious question: Is URL shortening still a thing? What are the use cases?
- intenscia 10y agoCongratulations on the release but I can just discourage people to use URL shorteners. They obfuscate key information, are potentially a security risk as a result, require extra http requests and what happens in the future when you turn the service off? A trend I've never fancied.
- corobo 10y agoOn the other hand if you're linking to something you don't control and you need to track stats then use branded URL shorteners. Sometimes there are valid use cases for things.