예제 #1
0
<style>
    a {text-decoration: none}
    a:hover {text-decoration: underline}    
</style>

<?php 
header("Content-type:text/html; charset=utf-8");
$code_url = $_POST["code_str"];
$prodname = $_POST["prod_name"];
$ldap = $_POST["ldap"];
$passwd = $_POST["passwd"];
include "../../util/util.php";
export_svn_code($code_url, $prodname, $ldap, $passwd);
$retArray = get_util_result();
$color = "green";
if ($retArray[0] == 1) {
    $color = "red";
}
echo "<font color='{$color}'>" . $retArray[1] . "</font>", " <a href='../../../index.php' style='color:blue'>返回</a>";
예제 #2
0
    if (is_dir($src_dir)) {
        return;
    }
    $exp_file = "svn_export.exp";
    $file_content = file_get_contents("svn_export.template");
    $file_content = str_replace('$user_name$', $user, $file_content);
    $file_content = str_replace('$password$', $password, $file_content);
    $file_content = str_replace('$current_file$', $exp_file, $file_content);
    $file_content = str_replace('$url$', $svn, $file_content);
    $file_content = str_replace('$dir$', $src_dir, $file_content);
    file_put_contents($exp_file, $file_content);
    $cmd = "expect {$exp_file}";
    exec($cmd, $lines, $ret);
    $ret_array[1] = array_pop($lines);
}
export_svn_code($user, $password, $svn, $src_dir);
if (strstr($ret_array[1], "failed") != false || strstr($ret_array[1], "doesn't exist") != false) {
    $ret_array[0] = 1;
    echo json_encode($ret_array);
    exit(1);
}
$cmd = "cd ../python; ./BeanFilesParser.py {$src_dir} {$product}";
exec($cmd, $lines, $ret);
if ($ret != 0) {
    $ret_array[0] = $ret;
    $ret_array[1] = "Error: 解析产品代码失败! 请确保类型和代码是匹配的";
    echo json_encode($ret_array);
    exit(1);
}
$time_str = strftime("%Y-%m-%d %H:%M:%S", time());
$line = "<tr><td>{$time_str}</td><td>{$user}</td><td>{$svn}</td><td class='prod'>{$product}</td></tr>\n";