Download the PHP package maestroerror/wget-download without Composer
On this page you can find all versions of the php package maestroerror/wget-download. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maestroerror/wget-download
More information about maestroerror/wget-download
Files in maestroerror/wget-download
Package wget-download
Short Description easy to use, chainable PHP class for downloading files, uses wget CLI
License MIT
Informations about the package wget-download
wget-download
easy to use, chainable PHP class for downloading files, uses wget CLI
Docs
I will try to provide some instructions, to better understand and use the main features of this little library.
- Installation
- Composer
- From github
- Initialization
- Options
- Logs
- Run
installation
via Composer:
Don't forget to require autoload.php file
from github:
Note: It needs wget command to be available from your terminal. Check with wget --help
or install: Run apt-get install wget
for linux or download for windows
Initialization of class (Construction)
You can construct object with 3 different ways: with array of configs, with string of URL or without any parameters (and provide them further). Which you choose, it depends on your needs:
Options
set speed limit:
enable continue after the interrupt, so if the internet connection stopped it will automatically resume the download after the connection is restored:
$checkCertificate is defined in wgd class as protected boolean property and by default it is set to false, you can use secure method, to allow HTTPS certificate check for specific downloads:
By default silent (download in background) mode is enabled, but for some specific downloads you can specify conditions:
Sometimes you should use a user agent for download. first, you need to allow and after set user agent for your download:
for multiple .txt downloads, you need .txt file with urls (line by line). Like in user agent case, first, allow multiple download with multiple method and then give .txt file to run:
Logs
default log file is defined as protected property in wgd class protected string $logFile = "wgetlog.txt";
, but if you need, you can specify with setLog method:
Run
The last step is an execution, you can start your download with run method: $file->run()
.
Now let's say, we need to download file on background, with secure connection, set speed limit 1MB and allow continue:
To Do
- Search for todo comments and fix them
- Add more use cases in examples
- Add config files
- Update documentation
- New release