Example #1
0
function findFolderRepeatFunction($folderPath)
{
    $filePath = '';
    $s = '';
    $c = '';
    $content = '';
    $Funs = '';
    $FunList = '';
    $AllFunList = '';
    $nOK = '';
    $nErr = '';
    $splStr = '';
    $splxx = '';
    $nAllOK = '';
    $nAllErr = '';
    $nI = '';
    $ErrFunList = '';
    $AllErrFunList = '';
    HandlePath($folderPath);
    //获得完整路径
    $c = '操作文件夹' . $folderPath . vbCrlf();
    $content = getDirFileList($folderPath, '');
    $splStr = aspSplit($content, vbCrlf());
    $nI = 0;
    foreach ($splStr as $key => $filePath) {
        $nI = $nI + 1;
        $s = $nI . '、' . $filePath;
        $content = getFText($filePath);
        $content = getScanFunctionNameList($content);
        //获得ASP函数名称列表
        $nOK = 0;
        $nErr = 0;
        $nAllOK = 0;
        $nAllErr = 0;
        $FunList = '';
        $ErrFunList = '';
        $AllErrFunList = '';
        $splxx = aspSplit($content, vbCrlf());
        foreach ($splxx as $key => $Funs) {
            if ($Funs != '') {
                if (inStr('|' . $FunList . '|', '|' . $Funs . '|') == 0) {
                    $FunList = $FunList . $Funs . '|';
                    $nOK = $nOK + 1;
                } else {
                    $ErrFunList = $ErrFunList . $Funs . '|';
                    $nErr = $nErr + 1;
                }
                if (inStr('|' . $AllFunList . '|', '|' . $Funs . '|') == 0) {
                    $AllFunList = $AllFunList . $Funs . '|';
                    //全部函数
                    $nAllOK = $nAllOK + 1;
                } else {
                    $AllErrFunList = $AllErrFunList . $Funs . '|';
                    $nAllErr = $nAllErr + 1;
                }
            }
            doEvents();
        }
        //Call CreateFile("allfun.txt", AllFunList)
        $c = $c . $s . ',函数(' . uBound($splStr) + 1 . '),重复(' . $nErr . '[' . $ErrFunList . '])全部函数重复(' . $nAllErr . '[' . $AllErrFunList . '])' . vbCrlf();
        doEvents();
    }
    $findFolderRepeatFunction = $c;
    return @$findFolderRepeatFunction;
}
Example #2
0
function makeHtmlWebToXmlZip($newWebDir, $rootDir)
{
    $xmlFileName = '';
    $xmlSize = '';
    $xmlFileName = setFileName(GetIP()) . '_update.xml';
    //获得ip有可能为空:: 创建时会有问题
    //newWebDir="\Templates2015\"
    //rootDir="\sharembweb\"
    $objXmlZIP = '';
    $objXmlZIP = new xmlZIP();
    $objXmlZIPcallRun(HandlePath($newWebDir), HandlePath($newWebDir . $rootDir), false, $xmlFileName);
    aspEcho(HandlePath($newWebDir), HandlePath($newWebDir . $rootDir));
    $objXmlZIP = $GLOBALS['Nothing'];
    doEvents();
    $xmlSize = getFSize($xmlFileName);
    $xmlSize = printSpaceValue($xmlSize);
    aspEcho('下载xml打包文件', '<a href=/tools/downfile.asp?act=download&downfile=' . xorEnc('/' . $xmlFileName, 31380) . ' title=\'点击下载\'>点击下载' . $xmlFileName . '(' . $xmlSize . ')</a>');
}
Example #3
0
function readTemplateFileSource($templateFilePath, $id)
{
    $startStr = '';
    $endStr = '';
    $s = '';
    $c = '';
    $startStr = '<!--#sourceHtml' . replace($id, '.html', '') . 'Start#-->';
    $endStr = '<!--#sourceHtml' . replace($id, '.html', '') . 'End#-->';
    $s = readTemplateFileModular($templateFilePath, $startStr, $endStr);
    if ($s == '[$NO$]') {
        //加一个读取本文本里配置列表(20150815)
        $c = getStrCut($GLOBALS['pubCode'], $startStr, $endStr, 2);
        if ($c != '') {
            $readTemplateFileSource = $c;
            //call rwend(c)
            return @$readTemplateFileSource;
        }
        $c = getFText($templateFilePath);
        //存在 <!--#TemplateSplitStart#-->  就返回当前全部内容
        if (inStr($c, '<!--#DialogStart#-->') > 0) {
            $readTemplateFileSource = $c;
            return @$readTemplateFileSource;
        }
        $s = '模板资源ID[' . $id . ']不存在,路径TemplateFilePath=' . HandlePath($templateFilePath);
    }
    $readTemplateFileSource = $s;
    return @$readTemplateFileSource;
}
Example #4
0
function batchImportDirTXTData($webdataDir, $tableNameList)
{
    $folderPath = '';
    $tableName = '';
    $splStr = '';
    $content = '';
    $splxx = '';
    $filePath = '';
    $fileName = '';
    $handleTableNameList = '';
    $splStr = aspSplit($tableNameList, vbCrlf());
    foreach ($splStr as $key => $tableName) {
        if ($tableName != '') {
            if ($GLOBALS['db_PREFIX'] != '') {
                $tableName = mid($tableName, len($GLOBALS['db_PREFIX']) + 1, -1);
            }
            $tableName = aspTrim(lCase($tableName));
            //判断表 不重复操作
            if (inStr('|' . $handleTableNameList . '|', '|' . $tableName . '|') == false) {
                $handleTableNameList = $handleTableNameList . $tableName . '|';
                $folderPath = HandlePath($webdataDir . '/' . $tableName);
                if (checkFolder($folderPath) == true) {
                    connexecute('delete from ' . $GLOBALS['db_PREFIX'] . $tableName);
                    //删除当前表全部数据
                    aspEcho('tableName', $tableName);
                    $content = getDirAllFileList($folderPath, 'txt');
                    $splxx = aspSplit($content, vbCrlf());
                    foreach ($splxx as $key => $filePath) {
                        $fileName = getFileName($filePath);
                        if ($filePath != '' && inStr('_#', left($fileName, 1)) == false) {
                            aspEcho($tableName, $filePath);
                            importTXTData(GetFText($filePath), $tableName, '添加');
                            doEvents();
                        }
                    }
                }
            }
        }
    }
}