当前位置: 首页>>代码示例>>PHP>>正文


PHP XString::clearDir方法代码示例

本文整理汇总了PHP中XString::clearDir方法的典型用法代码示例。如果您正苦于以下问题:PHP XString::clearDir方法的具体用法?PHP XString::clearDir怎么用?PHP XString::clearDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XString的用法示例。


在下文中一共展示了XString::clearDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build

    public function build()
    {/*{{{*/
        $this->myEcho("\n处理: ".get_class($this)."\n");
        $this->totalTimes = $this->getTotalDBTimes();
        $this->myEcho('数据获取次数: '.$this->totalTimes.' ('.$this->stepLen."条/次)\n");
        $this->myEcho('标准模版路径: '.$this->workPath."\n\n");
        $nowTimes= 1;
        $dataPond = array();
        XString::clearDir($this->workPath);
        $this->nowFile = 0;

        do{
            $this->myEcho('   #'.$nowTimes.' 读取');
            $datas = null;
            $datas = $this->getData($nowTimes, $this->stepLen);
            $this->myEcho(' -> 切片 ');
            $dataPond = $this->edward->shred($datas, $nowTimes, $this->totalTimes);
            $this->myEcho((string)$this->edward);

            if (count($dataPond))
            {
                $this->myEcho(' -> 保存');
            }
            foreach($dataPond as $data)
            {
                $this->myEcho(' '.$this->nowFile.'.'.self::SUFFIX_XML);
                $data = XString::convertEncoding($data, $this->charset, 'gbk');
                $this->write2File($data);
                unset($data);
                if($this->fileCntLimit != 0 && $this->nowFile >= $this->fileCntLimit)
                {
                    break 2;
                }
            }

            $nowTimes++;
            unset($dataPond);
            $this->myEcho("\n");
        } while ($nowTimes <= $this->totalTimes + 1);
    }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:40,代码来源:opendatasource.php

示例2: completeData

 private function completeData($functionName)
 {/*{{{*/
     $className = str_replace("test", '', $functionName);
     $this->assertTrue(class_exists($className), $className."类不存在\n");
     $factory = new OpenFactory;
     $factory->wrapData();
     $dataPath = $configs->standardPath.strtolower($className);
     $configs =  BeanFinder::get('configs');
     $resPath = $configs->resPath.strtolower($className);
     $this->assertTrue(is_dir($resPath), $resPath."路径不存在\n");
     $fileList = XString::listFile($resPath);
     $this->assertNotEmpty($fileList, $className."下没有文件\n");
     XString::clearDir($dataPath);
     foreach ($fileList as $key => $file)
     {
         if (strstr($file, 'xml') == false)
         {
             unset ($fileList[$key]);
         }
     }
     return $fileList;
 }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:22,代码来源:datasource.php

示例3: processSource

    private function processSource($sourceInfo)
    {/*{{{*/
        if( empty($sourceInfo['tpl']) || 
            empty($sourceInfo['data']) || 
            empty($sourceInfo['res']))
            return false;

        foreach ($sourceInfo['data'] as $dataName => $dataFiles)
        {
            $resDataPath = $this->resPath.$dataName."/";
            if (isset($sourceInfo['res']['subset']) && $sourceInfo['res']['subset'])
            {
                $resDataPath = $this->resPath.$dataName."_".$sourceInfo['res']['subset']."/";
            }
            XString::clearDir($resDataPath);
            foreach($dataFiles as  $num => $dataFile)
            {
                $resData = $this->wrap($sourceInfo['tpl'],$dataFile);
                $resDataFile = $resDataPath.$num.".".$sourceInfo['res']['extension'];
                XString::write2file($resData, $resDataFile);
                $this->myEcho("   写入 $resDataFile \n");
            }
        }
    }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:24,代码来源:wrapper.php


注:本文中的XString::clearDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。