Download the PHP package intrepidws/laravel-ssh-tunnel-fixed without Composer

On this page you can find all versions of the php package intrepidws/laravel-ssh-tunnel-fixed. 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 laravel-ssh-tunnel-fixed

Laravel SSH Tunnel

Access a service on a remote host, via an SSH Tunnel! For example, people have been asking how to connect to a MySQL server over SSH in PHP for years.

We had a similar challenge, specifically accessing a MySQL database over an SSH Tunnel and all of the Questions and Answers were helpful in finding a solution. However, we wanted something that would just plug and play with our Laravel applications and Lumen Services.

So we wrote this package. We hope you enjoy it!

Requirements

This package has been tested against Laravel/Lumen versions 5.2+

We do not support version <=5.1.

Installation

Register the Provider:

For Lumen services, add:

to bootstrap/app.php. For Laravel applications, add:

to the providers array in config/app.php.

Configuration

All configuration can and should be done in your .env file.

Quickstart

The simplest way to use the Tunneler is to set TUNNELER_ON_BOOT=true in your .env file. This will ensure the tunnel is in place everytime the framework bootstraps.

However, there is minimal performance impact because the tunnel will get reused. You only have to bear the connection costs when the tunnel has been disconnected for some reason.

Then you can just configure your service, which we will demonstrate using a database connection. Add this under 'connections' in your config/database.php file

And there you have it. Go set up your Eloquent models now.

Artisan Command

This artisan command will either verify the connection is up, or will create the connection. This probably isn't of great benefit for running manually, apart for testing your configuration.

However, if you would like to ensure that the tunnel is available all the time, and not do the work on bootstrap, you can use the Laravel Scheduler to schedule the artisan command to run at whatever interval you think is best to maintain your connection. In your App\Console\Kernel for example:

Then, assuming you have properly set up the Scheduler in cron, the artisan command will check the tunnel every five minutes and restart it if it isn't up.

Dispatch It

Perhaps your application rarely needs to do this, but when it does, you'd like to have an easy way to ensure the tunnel is in place before the connection attempt.

How Does it Work?

It first uses netcat (nc) via exec to check the local port to see if the tunnel is open. If the port is there, it does nothing else.

If the port isn't there, it then creates the ssh tunnel connection command and executes that via exec after execution we wait the defined TUNNELER_CONN_WAIT time before running netcat again to verify that the connection is in place.

That's it. The tunnel will stay up until it times out, if it times out, and depending on the strategy you have chosen to ensure it is up and available when you need it, it will simply be recreated on demand.


All versions of laravel-ssh-tunnel-fixed with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^5.2
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 intrepidws/laravel-ssh-tunnel-fixed contains the following files

Loading the files please wait ....