Live data from Hacker News

Polr – A modern, minimalist, and lightweight URL shortener in PHP

github.com

11–20 of 28 posts

Re: Polr – A modern, minimalist, and lightweight URL shortener in PHP

#12
post #2

I'm always amazed to see minimalist used to describe a dozen placeholder directories and files. That said, the code is clean and modern php.

Minimalist 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.

I 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.

Re: Polr – A modern, minimalist, and lightweight URL shortener in PHP

#14
Not 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://github.com/sanshi0518/shorturl-nginx

Re: Polr – A modern, minimalist, and lightweight URL shortener in PHP

#15

Wouldn'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.

TBH, 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.

Re: Polr – A modern, minimalist, and lightweight URL shortener in PHP

#20
post #17

Why is the entire vendor directory in github? I'm fairly certain some of those packages cannot be redistributed like that.

Agree. What is the point of using composer or any dependency manager if you check-in the vendor folder?

Because 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.

Post reply on HN