Download the PHP package viharm/php-aria2-rpc without Composer

On this page you can find all versions of the php package viharm/php-aria2-rpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-aria2-rpc

phpAria2rpc

Version 2.4.0
Changes https://github.com/viharm/phpAria2rpc/pull/7
Download https://github.com/viharm/phpAria2rpc/releases
Issues https://github.com/viharm/phpAria2rpc/issues
License Modified BSD (3-clause)
Language PHP

Library to communicate with aria2 using json-RPC.

Based on shiny's php-aria2.

Install

Pre-requisites

Download

Archive

Get the release archives from downloads

Composer

From v2.4.0 onwards, phpAria2rpc is enabled for Composer, and is available on Packagist as viharm/php-aria2-rpc. This library can be installed standalone or included in any project with Composer usage.

Standalone

A standalone copy of this project can be installed with Composer

The above command will install phpAria2rpc in a sub-directory phpAria2rpc of the current working directory.

Dependency

To make Composer automatically install phpAria2rpc as a dependency include the following in your composer.json

This will install phpAria2rpc in the standard vendor sub-directory of a typical Composer-enabled project.

Clone

Clone repository.

Remember to clone recursively (--recurse-submodules) to ensure cloning the submodules.

Deploy

Save the downloaded directory structure in your choice of path within your application (plugins, includes, etc.)

Configure

No specific configuration required yet.

Usage

Run Aria2 in daemon mode

There are several recommended options for configuring Aria2 however the minimum necessary to get started are...

Assuming that the Aria2 binary is in your execution path, run it with the above options...

To enable auto-start on most Linux systems, add the following in /etc/rc.local before the exit line...

Use

Include the library in your application code

Create an instance

phpAria2rpc uses safe defaults for Aria2 running on the same host as the script is running on. See advanced usage for custom configuration

Once the object is created, the library tests the connection by querying the version of Aria2. The status (success or failure) of this query is saved in a boolean:

This boolean can be used in the logic of the calling function/script to formulate escape routes in case of connection failure.

Call Aria2 methods

Advanced usage

Advanced configuration allows custom settings. Formulate a server configuration array

This array is passed as a parameter only once, whilst creating an instance of the class.

phpAria2rpc inserts the correct value as per Aria2's requirement.

Further usage is normal, by calling Aria2 methods against phpAria2rpc.

Secure RPC

If Aria2 is configured for secure RPC, then set the secure key value in the $server array to TRUE.

If self-signed certificates are used, then the appropriate CA certificate will have to be copied over to the host running this library and its path specified in the cacert key value in the $server array.

RPC secret token

If Aria2 has been configured with a secret token on the RPC interface then this should be specified in the rpcsecret key value in the $server array.

Legacy RPC authentication

phpAria2rpc can also be configured to connect to Aria2 daemons with the legacy username/password authentication for the RPC interface.

Please note that the use of this method of authentication is deprecated by the Aria2 authors, however still supported by phpAria2rpc for compatibility with older versions of Aria2 without the newer secret token authentication.

RPC username (legacy)

Specify the RPC username in the rpcuser key value of the $server array.

RPC password (legacy)

Specify the RPC password in the rpcpass key value of the $server array.

Connecting through proxy

phpAria2rpc allows connecting to the desired instance of Aria2 via proxy. This can be accomplished by adding an sub-array item proxy to the array parameter passed to the class.

This sub-array associative and is used for setting the proxy configuration.

Please refer to the proxy configuration or documentation of your proxy service for information on values specific to the application environment.

It has the following elements.

Type

Use the value for the key type to specify the type of proxy to use. Currently only http and socks5 types are supported.

There is no default value for this parameter.

Host

Use the value for the key host to specify the proxy host to use. Both IP addresses and resolvable host names are allowed.

There is no default value for this parameter.

Port

Use the value for the key port to specify the port of the proxy service. This is the port that the proxy service is listening for connections on.

There is no default value for this parameter.

Proxy authentication

If the proxy server requires authentication, then this can be achieved by two more items in the proxy sub-array.

Remember that this is different from the RPC authentication for Aria2.

Examples

Download a File

Returned Data

Can't Download
Downloading (Active)
Downloaded

Known limitations

Support

Please refer to the documentation of Aria2

Debugging can be enabled by setting boolean $GLOBALS['bl_DebugSwitch'] to TRUE.

Note, that this requires phpKhelper >= v01.02.01

For issues, queries, suggestions and comments please create an (issue/ticket][https://github.com/viharm/phpAria2rpc/issues).

Contribute

Please feel free to clone/fork and contribute via pull requests. Donations also welcome, simply create an issue/ticket.

Please make contact for more information.

Environment

Tested on:

Licence

Licensed under the modified BSD (3-clause) license.

A copy of the license is available...

References

php-aria2

Credits

Tools

Kint

Kint debugging library (http://raveren.github.io/kint/), used under the MIT license

Copyright (c) 2013 Rokas Å leinius (raveren at gmail dot com)

Utilities

Codiad

Codiad web based IDE (https://github.com/Codiad/Codiad), used under a MIT-style license.

Copyright (c) Codiad & Kent Safranski (codiad.com)

CodeGit

CodeGit Git plugin for Codiad (https://github.com/Andr3as/Codiad-CodeGit), used under a MIT-style license.

Copyright (c) Andr3as [email protected]

VS Code

Visual Studio Code code editor, used under the Microsoft Software License.

jEdit

jEdit text editor (http://www.jedit.org/), used under the GNU GPL v2.

Copyright (C) jEdit authors.

Ungit

Ungit client for Git (https://github.com/FredrikNoren/ungit) used under the MIT license

Copyright (C) Fredrik Norén

GitHub

Hosted by GitHub code repository (github.com).


All versions of php-aria2-rpc with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
mnsami/composer-custom-directory-installer Version 1.1.*
viharm/php-khelper Version ^1.4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package viharm/php-aria2-rpc contains the following files

Loading the files please wait ....