You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several users have asked for the ability to use the library without composer. One example would be for simple standalone scripts. We need to investigate what's involved and add docs/update code as necessary to address.
So upon spending some time behind it, I feel like we should not try to use it without composer as resolving the dependency manually is a real pain. Here is my current library inclusion looks like
require_dir is a small function to include all files in a dir. we can't use it always though (where sequence is needed)
if you still believe we should have instructions to use it, i'll probably write a bash script to download all these repo (git or zip), extract so that they can just copy the require_once lines in their script.
We write one file that has all the requires in it and then the user can require that
Yeah, that's what I implied. If we write the bash script to download all libs in a directory, then a giant php file will require them (as path is known, it'll work) and then user just requires that file.
Have a .zip file available with all dependencies and some sort of autoloader.php file that one can require which in turn requires all the external dependencies. It almost seems that some of them are basically bundling the results of using Composer. So it's almost like a Composer "snapshot" of sorts. But as I'm one of those folks that has never used Composer, I couldn't say for sure if that is the case. It does "appear" to be some sort of auto-generated package usually. Here's one example: https://mandrillapp.com/api/docs/index.php.html
Others have a separate git repository so that you can clone the repo (nice for staying up to date). This approach has the side-effect of automatically making a .zip file available for download if someone is unfamiliar with git.
Activity
rajumsys commentedon May 5, 2017
I'm looking into this
rajumsys commentedon May 6, 2017
So upon spending some time behind it, I feel like we should not try to use it without composer as resolving the dependency manually is a real pain. Here is my current library inclusion looks like
And it's not working due to following error:
While I believe we can fix the above error (just need to read some more docs/codes) but it's already going insane.
It's due to our library's dependency on pluggable http library.
rajumsys commentedon May 8, 2017
So, finally got it working. The require'ing still looks insane.
require_dir
is a small function to include all files in a dir. we can't use it always though (where sequence is needed)if you still believe we should have instructions to use it, i'll probably write a bash script to download all these repo (git or zip), extract so that they can just copy the
require_once
lines in their script.richleland commentedon May 8, 2017
Some ideas:
require
s in it and then the user can require thatIt's also worth looking at how other services handle this to see if we can learn anything from them.
rajumsys commentedon May 8, 2017
Yeah, that's what I implied. If we write the bash script to download all libs in a directory, then a giant php file will require them (as path is known, it'll work) and then user just requires that file.
nosilver4u commentedon May 8, 2017
Other services tend to do things one of two ways: