PHP code example of falc / robo-system-package
1. Go to this page and download the library: Download falc/robo-system-package library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
falc / robo-system-package example snippets
class RoboFile extends \Robo\Tasks
{
use Falc\Robo\Package\loadTasks;
// ...
}
$this->taskPackageInstall()
->packageManager('yum')
->package('package1')
->run();
$this->taskPackageInstall()
->packageManager('yum')
->packages(['package1', 'package2'])
->run();
$this->taskPackageInstall('yum', ['package1', 'package2'])->run();
$install = $this->taskPackageInstall('yum', ['package1']);
if ($
$this->taskPackageInstall()
->packageManager('yum')
->package('package1-*') // Installs all packages starting with "package1-"
->run();
$installTask = $this->taskPackageInstall()
->packageManager('yum')
->packages(['package1', 'package2']);
$this->taskSshExec('remote.example.com')
->remoteDir('/home/user')
->printed(false) // Do not display output
->exec($installTask)
->run();
$this->taskPackageUninstall()
->packageManager('yum')
->package('package1')
->run();
$this->taskPackageUninstall()
->packageManager('yum')
->packages(['package1', 'package2'])
->run();
$this->taskPackageUninstall('yum', ['package1', 'package2'])->run();
$this->taskPackageUninstall()
->packageManager('yum')
->package('package1-*') // Uninstalls all packages starting with "package1-"
->run();
$uninstallTask = $this->taskPackageUninstall()
->packageManager('yum')
->packages(['package1', 'package2']);
$this->taskSshExec('remote.example.com')
->remoteDir('/home/user')
->printed(false) // Do not display output
->exec($uninstallTask)
->run();
$this->taskPackageUpdate()
->packageManager('yum')
->package('package1')
->run();
$this->taskPackageUpdate()
->packageManager('yum')
->packages(['package1', 'package2'])
->run();
$this->taskPackageUpdate()
->packageManager('yum')
->run();
// Update some packages
$this->taskPackageUpdate('yum', ['package1', 'package2'])->run();
// Update everything
$this->taskPackageUpdate('yum')->run();
$this->taskPackageUpdate()
->packageManager('yum')
->package('package1-*') // Updates all packages starting with "package1-"
->run();
$updateTask = $this->taskPackageUpdate()
->packageManager('yum')
->packages(['package1', 'package2']);
$this->taskSshExec('remote.example.com')
->remoteDir('/home/user')
->printed(false) // Do not display output
->exec($updateTask)
->run();