-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphp-deploy
More file actions
executable file
·57 lines (40 loc) · 1.22 KB
/
Copy pathphp-deploy
File metadata and controls
executable file
·57 lines (40 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env php
<?php
function build_command($arguments = array(), $options = array())
{
#$env = $arguments['server'];
$ini = sfConfig::get('sf_config_dir').'/properties.ini';
if (!file_exists($ini)) {
die('You must create a [config/]properties.ini file');
}
$properties = parse_ini_file($ini, true);
if (!isset($properties['host'])) {
die('You must define a "host" entry.');
}
if (!isset($properties['dir'])) {
die('You must define a "dir" entry.');
}
$host = $properties['host'];
$dir = $properties['dir'];
$user = isset($properties['user']) ? $properties['user'].'@' : '';
$is_first = (bool) $properties['first_time'];
if (!$is_first && substr($dir, -1) != '/') {
$dir .= '/';
}
$ssh = 'ssh';
if (isset($properties['port'])) {
$port = $properties['port'];
$ssh = '"ssh -p'.$port.'"';
}
if (isset($properties['parameters'])) {
$parameters = $properties['parameters'];
}
#$dryRun = $options['go'] ? '' : '--dry-run';
$command = "rsync $dryRun $parameters -e $ssh ./ $user$host:$dir";
#$this->getFilesystem()->execute($command, $options['trace'] ? array($this, 'logOutput') : null, array($this, 'logErrors'));
#$this->clearBuffers();
return $command;
}
function execute_command() {
}
?>