12 ms·
Mate, seriously, use composer and packagist.
by jnardiello 11y ago
Mate, seriously, use composer and packagist.
- TazeTSchnitzel 11y agoAlso maybe a namespace. I doubt they're the only person to have ever made a class called `\Client` :) http://phptherightway.com/ http://phptherightway.com/ Though I notice that the README states "[i]ts goal [is] to have one easy to use PHP file without dependencies", and they point out there's already a proper package out there, kelunik/acme. If the goal is a single file with no dependencies, I can understand the lack of Composer, as it's not really targeted at that audience.
- Raed667 11y agoThank you for the great link.
- jnardiello 11y agoIf the target audience are those developers manually including everything, then it's not a package for me. Using composer is completely unrelated to having (or rather not) dependencies. It's actually pretty much the opposite: a way of distributing your package to projects who wish to use it. So again: please use composer. Completely agree with the namespace. You HAVE to namespace it :) Hope it helps
- efesak2 11y agoComposer is awesome, but this is not a package ready to use! (at least not now). Valid point for namespace.
- mschuster91 11y agoWell, composer needs to be installed and present on the system. As the author states, minimal dependencies. Hell why doesn't everyone follow this? Instead I see projects with five or more build tools needed to deploy a website. A single small website depending on... PHP/MySQL (obviously), Symfony, composer, npm, grunt, bower, ant, vagrant, docker. And well, language dependencies not needed by the website itself, just for the buildtools: python, nodejs, ruby, java plus virtualbox for vagrant! All of this for a setup that can be (with proper documentation) replicated by hand and from scratch in <10 minutes (Debian, not RPM-based crap). The fuck are you smoking, people? Took me even WITH documentation about all those build tools 30min to get running where a simple git clone should be all that's needed. Bonus side effect: if you need to hack stuff in your deps, it's easier to ship them in your repo than if you use composer and friends. I'd coin a new term for this: tool-sturbation.
- jnardiello 11y agoYou just don't get it :) Whoever wish to include manually this package and use it like if it was 1993 will still be able to do by cloning this repo and including the file by hand. On the other side, 99% of the sane PHP that has been written in the last few years including fairly large projects, WILL use composer to manage external dependencies as it's probably the single project who made PHP a modern language. So, what are the cons of releasing this as a package? I'm not even starting the conversation where I'm trying to convince you that using a dependencies manager is always a good thing to keep the codebase sane and clean - even for small scripts. That "<10 mins thing" is an empty claim as you have to do a boilerplate once and can use it all the time (unless you are the kind of programmer who is not 'good-lazy' but rather 'bad-lazy' and love to re-do its job by hand over and over)
- degenerate 11y ago"99% of sane PHP" is not the audience here. There are millions and millions of shared hosting accounts running basic cPanel + PHP + some minimal form of SSH access - those are the people that won't have a way to install LetsEncrypt otherwise, except for the ability to execute some random PHP file in their SSH home directory. Step out of your walled garden and buy yourself a crappy $5/mo hosting account, and you will see why the author's choices are a blessing in disguise.
- mschuster91 11y agoA pity you're being downvoted. People forget not everyone has the bucks to shell out for even a webhost with SSH enabled.
- Killswitch 11y ago$5/mo shared hosting plan where you're walled and can't do anything you want, or $5/mo VPS at Digital Ocean where you have SSH enabled by default and can install anything you want. of course, people don't have the bucks to shell out for that. I get it.
- 3dfan 11y agoHell, no! A single PHP file is the perfect solution to this. Call it from /etc/crontab and you are done. I hate overladen projects on GitHub with all kinds of fluff. A single source file and a readme is just awesome.
- jnardiello 11y agoAnd how distributing this as a composer package would stop you from cloning the repo manually and still use the class as if it had no composer json? On the other hand, what if you have a slightly more complex system with some logic to handle crons?
- 3dfan 11y agoJust fork and add whatever your "more complex system" needs. But don't force this complexity on me. I work hard to keep my systems simple.
- Navarr 11y agoIt requires at least two PHP files. One that ACTUALLY DOES WHAT YOU WANT and the library files. Since you have to write a new PHP file anyway, composer allows you to pull in the latest version (or update it) with semver constraints. Then you can package it as a phar and call it that way. This is a library, not a file to run, and so it should have composer support. Or, if you don't want to package it as a PHAR - since I have no idea how to do that, you'd implement your version in some directory and probably alias a command to it. TL;DR: This is a library, not a script. It should have composer support.
- debaserab2 11y agoPull request with composer added here: https://github.com/analogic/lescript/pull/5 https://github.com/analogic/lescript/pull/5 Hopefully the author sees it
- efesak2 11y agoDONE :)