forked from zroger/drush-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdrupal_server
More file actions
executable file
·42 lines (35 loc) · 818 Bytes
/
drupal_server
File metadata and controls
executable file
·42 lines (35 loc) · 818 Bytes
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
#!/usr/local/bin/php
<?php
$args = array();
// Build the command
$cmd = 'drush server start ';
unset($_SERVER['argv'][0]);
$cmd .= implode(' ', $_SERVER['argv']);
echo "running command $cmd\n";
passthru($cmd);
// Get the log file location
// Does the log dir arg exists
if (!empty($args['log-dir']))
$log_dir = $args['log-dir'];
else {
$conf_dir = empty($args['conf-dir']) ? '.drush-server' : $args['conf-dir'];
$log_dir = "$conf_dir/log";
}
$log_file_path = "$log_dir/error_log";
// Open Stream to screen
$stdout = fopen('php://stdout', 'w');
$line = 0;
While (TRUE) {
// Open file the file
$log_file = @fopen($log_file_path, r);
$cur_line = 1;
while (($buffer = fgets($log_file, 4096)) !== false) {
$cur_line++;
if ($cur_line > $line) {
echo $buffer;
$line++;
}
}
fclose($log_file);
}
?>