Home >Backend Development >PHP Tutorial >SourceTree Export 出错

SourceTree Export 出错

WBOY
WBOYOriginal
2016-06-20 12:29:551316browse

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%


export.php
<?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 编码,看看是否有正常输出

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn