Heim > Artikel > Backend-Entwicklung > SourceTree Export 出错
http://my.oschina.net/zgldh/blog/185259
我按照这篇文档制作导出功能,出现以下错误
export.bat
@set export_php="D:\My\Libraray3\tool\export.php"@set export_dir="D:\My\Libraray3\export"@set source_files=%*@rmdir %export_dir% /s/q@mkdir %export_dir%@php %export_php% %source_files%@explorer %export_dir%
<?php date_default_timezone_set('Asia/Shanghai'); if($argc == 0) { exit('Nothing to copy'); } define('DS', DIRECTORY_SEPARATOR); // I always use this short form in my code. $source_dir = 'D:'.DS.'My'.DS.'Libraray3'; $exp_dir = 'D:'.DS.'My'.DS.'Libraray3'.DS.'export'; function ExportOneFile($path) { global $source_dir,$exp_dir; $final_source = $source_dir.DS.$path; $final_dest = $exp_dir.DS.$path; $final_dest_dir = dirname($final_dest).DS; if(!is_dir($final_dest_dir)) { mkdir($final_dest_dir,0777,true); } return copy($final_source,$final_dest); } foreach($argv as $index=>$path) { if($index === 0) { continue; } if(ExportOneFile($path)) { echo $index.' : '.$path." exported\n"; } } echo "All Complete. Please go to $exp_dir to view files";
你先吧浏览器切换到 gbk 编码,看看是否有正常输出