當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。