PHP code example of lukaskleinschmidt / kirby-terminal
1. Go to this page and download the library: Download lukaskleinschmidt/kirby-terminal 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/ */
lukaskleinschmidt / kirby-terminal example snippets
return [
'lukaskleinschmidt.terminal.scripts' => [
'hello-world' => 'echo "Hello World!"',
'list-index' => function () {
return 'ls';
},
'list-content' => function () {
$cwd = $this->kirby()->root('content') . '/' . $this->diruri();
// Set the current working directory for the script
return script('ls', $cwd);
},
]
];
return [
'lukaskleinschmidt.terminal.scripts' => [
'deploy' => function () {
$source = $this->kirby()->root('content') . '/\./' . $this->diruri();
$target = '[email protected]:/var/www/html/content';
// If you are not 100% certain you have the right path on the remote
// server then test this command without the --delete flag first
return "rsync --delete --relative -avz $source $target";
}
]
];