Download the PHP package myvon/devicechanger without Composer

On this page you can find all versions of the php package myvon/devicechanger. 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 devicechanger

devicechanger

You want your user to send you data through another device (for example a phone) without leaving your page ? This small library help you to !

How it works

This package allow to send a link through any method and check if the user has sent the data needed.

Installation

You can install the package via composer:

Creating the file your user is sent to

You first need to create the file where your user will be redirected to send the required data.

You can check the examples/upload.php file to see an example of a file where the user is invited tu upload a file

Choosing an url generator

The second step is to choose a way to generate the url to the file. Two generator are provided by default:

For the dummy generator, simply provide the public url to the file :

For the bitly generator, you'll need to provide the public url and your bitly access token :

Creating your own generator

You can create your own generator by implementing the Myvon\DeviceChanger\UrlGeneratorInterface interface. You'll simply need to implement the public function getUrl(string $uid) method which return the generated url, or false if the generation failed.

Choosing a channel to send the link

After choosing the generator, you will need to choose through which channel you send the link. Two senders are provided by default:

To use the OvhSmsGenerator you'll to provide :

Creating a custom channel

You can create a custom channel by implementing the Myvon\DeviceChanger\SenderInterface interface. You'll need to implement the two following methods:

Specify the storage

The last step to use the library is to specify how the data are stored and how to check to they have been received.

For now the only storage provided by default is the Myvon\DeviceChanger\FileStorage which use the filesystem to store the data (mainly used for upload).

You'll simply need to provide the directory where the data will be stored:

Adding custom storage

If you need to create a custom storage you can do it by implementing the Myvon\DeviceChanger\StorageInterface interface. You'll need to implement the two following methods:

Sending the link

You can finally use the Myvon\DeviceChanger\DeviceChanger class to send the link and check if the data are received.

You will need to provide :

The message can be personalized with parameters (see the send method bellow) and must contain "%url%" which will be replaced by the generated url.

The parameters must follow this pattern : "%myparameter%"

You can then send the message:

You can provide your parameters as second argument to the method :

Check if the data are received

Now the link has been sent, you can check if your user has submitted the data :

To retrieve the data :

Note that the Myvon\DeviceChanger\FileStorage class will return the full path to the directory where the file(s) have been received.

Examples

You can check the following examples:

Testing

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.


All versions of devicechanger with dependencies

PHP Build Version
Package Version
No informations.
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 myvon/devicechanger contains the following files

Loading the files please wait ....