Toolkit Kullanımı
Toolkit, Liman eklentilerinin geliştirilmesini kolaylaştırmak için çeşitli yardımcılar ve sınıflar sağlayan bir kütüphanedir.

Örnekler

Distro

1
use Liman\Toolkit\OS\Distro;
Copied!
1
Distro::debian('apt install nano -y')
2
->centos('yum install nano -y')
3
->runSudo();
Copied!
1
Distro::debian("echo 'debian'")
2
->centos("echo 'centos'")
3
->centos6("echo 'centos6'")
4
->centos7("echo 'centos7'")
5
->pardus19("echo 'pardus19'")
6
->pardus192("echo 'pardus19.2'")
7
->pardus193("echo 'pardus19.3'")
8
->ubuntu("echo 'ubuntu'")
9
->ubuntu1804("echo 'ubuntu18.04'")
10
->ubuntu2004("echo 'ubuntu20.04'")
11
->ubuntu2010("echo 'ubuntu20.10'")
12
->default("echo 'Hiçbiri değil'")
13
->run();
Copied!

Command

1
use Liman\Toolkit\Shell\Command;
Copied!
1
echo Command::run('hostname');
Copied!
1
Command::runSudo('hostnamectl set-hostname @{:hostname}', [
2
'hostname' => request('hostname')
3
]);
Copied!
1
use Liman\Toolkit\Shell\SSHEngine;
Copied!
1
SSHEngine::init(
2
request('ipAddress'),
3
request('username'),
4
request('password')
5
);
6
Command::bindEngine(SSHEngine::class);
7
echo Command::run('hostname');
Copied!

Formatter

1
use Liman\Toolkit\Formatter;
Copied!
1
echo Formatter::run('hostnamectl set-hostname @{:hostname}', [
2
'hostname' => request('hostname')
3
]);
4
5
//output: hostnamectl set-hostname pardus
Copied!

Validation

1
validate([
2
'hostname' => 'required|string'
3
]);
Copied!
Last modified 3mo ago
Export as PDF
Copy link