Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thelfensdrfer/yii2sshconsole
Controller with ssh commands for the yii2 console
https://github.com/thelfensdrfer/yii2sshconsole
php ssh yii2 yii2-console
Last synced: 2 months ago
JSON representation
Controller with ssh commands for the yii2 console
- Host: GitHub
- URL: https://github.com/thelfensdrfer/yii2sshconsole
- Owner: thelfensdrfer
- License: mit
- Created: 2014-04-24T12:16:24.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-28T09:28:50.000Z (over 8 years ago)
- Last Synced: 2024-04-14T02:25:09.743Z (9 months ago)
- Topics: php, ssh, yii2, yii2-console
- Language: PHP
- Size: 12.7 KB
- Stars: 23
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yii2 SSH Console
Controller with ssh commands for the yii2 console.
## Example
```php
connect('example.com', [
'username' => 'myusername',
'password' => 'mypassword', // optional
]);// Or via private key
/*
$this->connect('example.com', [
'username' => 'myusername',
'key' => '/path/to/private.key',
'password' => 'mykeypassword', // optional
]);
*/$output = $this->run('echo "test"');
echo 'Output: ' . $output; // Output: test$output = $this->run([
'cd /path/to/install',
'./put_offline.sh',
'git pull -f',
'composer install',
'./yii migrate --interactive=0',
'./build.sh',
'./yii cache/flush',
'./put_online.sh',
]);// Or via callback
$this->run([
'cd /path/to/install',
'./put_offline.sh',
'git pull -f',
'composer install',
'./yii migrate --interactive=0',
'./build.sh',
'./yii cache/flush',
'./put_online.sh',
], function($line) {
echo $line;
});
}
}
```And then in the local console:
```bash
./yii deploy
```