Sync

Sync use scp command for deploy file(s)/folder(s) to remote server.

Installation

composer require mediashare/kernel
Bash

Code

<?php
// ./deploy.php
require 'vendor/autoload.php';
use Mediashare\Kernel\Kernel;
// Kernel
$kernel = new Kernel();
$kernel->run();

// Deploy
$sync = $kernel->get('Sync');
$sync->username = "username";
$sync->host = "blog.com";
$sync->directory = "blog";
$sync->destination = "/var/www";
$sync->run();
PHP

This script execute SCP command line like this:

scp -r blog username@blog.com:/var/www
Bash

MarquandT

Ethical Hacker ~ Web Developper ~ Hosting Provider ~ Crypto Enthusiast ~ Automation Expert Bitcoin donation: 32Uu4NKGnxSPC7UukYXVyRHwbppbQpKVki

Comments

You must login to send a comment.