function cache_images($images)
{
    rrmdir(__DIR__ . '/img');
    mkdir(__DIR__ . '/img');
    foreach ($images as $id => $image) {
        cache_file(get_raw_url($image->path), __DIR__ . '/img/' . basename($image->path));
    }
}
Beispiel #2
0
$code_v0 = "https://dev.corp.youdao.com/svn/outfox/products/ad/biz-dataviewer/trunk";
$code_v1 = "https://dev.corp.youdao.com/svn/outfox/products/ad/biz-dataviewer/branches/dspTang@490868";
$code_v2 = "https://dev.corp.youdao.com/svn/outfox/products/ad/biz-dataviewer/branches/aggregate@489920";
$skip_test_files = "0";
$simple_view = "0";
$same_update_view = "1";
*/
### dollar sign is key word for expect script
$passwd = str_replace('$', '\\$', $passwd);
// In case someone like to use https://xxx:34343
$code_v0 = preg_replace("/:(\\d+)\$/", "@\\1", $code_v0);
$code_v1 = preg_replace("/:(\\d+)\$/", "@\\1", $code_v1);
$code_v2 = preg_replace("/:(\\d+)\$/", "@\\1", $code_v2);
$code_v0_raw = get_raw_url($code_v0);
$code_v1_raw = get_raw_url($code_v1);
$code_v2_raw = get_raw_url($code_v2);
// save user query log
function save_log($ldap, $code_v0, $code_v1, $code_v2)
{
    $line = "<tr><td>" . strftime("%Y-%m-%d %H:%M:%S", time()) . "</td><td>" . $ldap . "</td><td><div name='src_ver'>{$code_v0}</div><div name='old_ver'>{$code_v1}</div><div name='new_ver'>{$code_v2}</div></td></tr>";
    file_put_contents(LOG_FILE, "{$line}\n", FILE_APPEND);
}
function get_raw_url($url_str)
{
    $list = explode("@", $url_str);
    $url = array_shift($list);
    return trim($url, "/");
}
function get_diff_summary($ldap, $passwd, $src_code, $code_new, $code_raw)
{
    global $code_v0_raw;