天天看點

PHP更新svn的代碼

 <?php

header("Content-type: text/html; charset=utf-8");

$username  = 'leo';   

$password  = '123465';   

$dir  = 'E:/www/'; 

$text = '已經是最新版,無需更新。'; 

exec("svn up --username $username --password $password $dir 2>&1", $msg); 

if(count($msg) == 2){

    $content = $msg[1].$text;

    echo iconv('gbk','utf-8',$msg[1]).'<br/>'.$text;

}else{

    foreach($msg as $key=>$value){

        echo iconv('gbk','utf-8',$value)."<br/>";

    }

}

?>