當前位置: 首頁>>代碼示例>>PHP>>正文


PHP KTUtil::deleteDirectory方法代碼示例

本文整理匯總了PHP中KTUtil::deleteDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP KTUtil::deleteDirectory方法的具體用法?PHP KTUtil::deleteDirectory怎麽用?PHP KTUtil::deleteDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在KTUtil的用法示例。


在下文中一共展示了KTUtil::deleteDirectory方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: downloadZipFile

 /**
  * Download the zip file
  */
 function downloadZipFile($exportCode = NULL)
 {
     if (!(isset($exportCode) && !empty($exportCode))) {
         $exportCode = KTUtil::arrayGet($_SESSION['zipcompression'], 'exportcode');
     }
     $aData = KTUtil::arrayGet($_SESSION['zipcompression'], $exportCode);
     if (!empty($aData)) {
         $sZipFile = $aData['file'];
         $sTmpPath = $aData['dir'];
     } else {
         $sZipFile = $this->sZipFile;
         $sTmpPath = $this->sTmpPath;
     }
     if (!file_exists($sZipFile)) {
         return PEAR::raiseError(_kt('The zip file has not been created, if you are downloading a large number of documents
         or a large document then it may take a few minutes to finish.'));
     }
     $mimeType = 'application/zip; charset=utf-8;';
     $fileSize = filesize($sZipFile);
     $fileName = $this->sZipFileName . '.' . $this->extension;
     KTUtil::download($sZipFile, $mimeType, $fileSize, $fileName);
     KTUtil::deleteDirectory($sTmpPath);
     return true;
 }
開發者ID:5haman,項目名稱:knowledgetree,代碼行數:27,代碼來源:compressionArchiveUtil.inc.php

示例2: cleanup

 function cleanup()
 {
     if ($this->sBasePath && file_exists($this->sBasePath)) {
         KTUtil::deleteDirectory($this->sBasePath);
         $this->sBasePath = null;
     }
 }
開發者ID:sfsergey,項目名稱:knowledgetree,代碼行數:7,代碼來源:zipimportstorage.inc.php

示例3: downloadZipFile

 /**
  * Download the zip file
  */
 function downloadZipFile($exportCode = NULL)
 {
     if (!(isset($exportCode) && !empty($exportCode))) {
         $exportCode = KTUtil::arrayGet($_SESSION['zipcompression'], 'exportcode');
     }
     $aData = KTUtil::arrayGet($_SESSION['zipcompression'], $exportCode);
     if (!empty($aData)) {
         $sZipFile = $aData['file'];
         $sTmpPath = $aData['dir'];
     } else {
         $sZipFile = $this->sZipFile;
         $sTmpPath = $this->sTmpPath;
     }
     if (!file_exists($sZipFile)) {
         return PEAR::raiseError(_kt('The ZIP file can only be downloaded once - if you cancel the download, you will need to reload the page.'));
     }
     $mimeType = 'application/zip; charset=utf-8;';
     $fileSize = filesize($sZipFile);
     $fileName = $this->sZipFileName . '.zip';
     KTUtil::download($sZipFile, $mimeType, $fileSize, $fileName);
     KTUtil::deleteDirectory($sTmpPath);
     return true;
 }
開發者ID:sfsergey,項目名稱:knowledgetree,代碼行數:26,代碼來源:compressionArchiveUtil.inc.php

示例4: removeFolderTree

 function removeFolderTree($oFolder)
 {
     $oConfig =& KTConfig::getSingleton();
     $sPath = sprintf("%s/%s", $oConfig->get('urls/documentRoot'), $oFolder->generateFolderPath($oFolder->getID()));
     KTUtil::deleteDirectory($sPath);
 }
開發者ID:sfsergey,項目名稱:knowledgetree,代碼行數:6,代碼來源:ondiskpathstoragemanager.inc.php

示例5: performPostUpgradeActions

function performPostUpgradeActions()
{
    // This is just to test and needs to be updated to a more sane and error resistent architrcture if it works.
    // It should idealy work the same as the upgrades.
    global $default;
    // Ensure all plugins are re-registered.
    $sql = "TRUNCATE plugin_helper";
    $res = DBUtil::runQuery($sql);
    // Clear out all caches and proxies - they need to be regenerated with the new code
    $proxyDir = $default->proxyCacheDirectory;
    KTUtil::deleteDirectory($proxyDir);
    $oKTCache = new KTCache();
    $oKTCache->deleteAllCaches();
    // Clear the configuration cache, it'll regenerate on next load
    $oKTConfig = new KTConfig();
    $oKTConfig->clearCache();
    // Unlock the scheduler
    $lockFile = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock';
    if (file_exists($lockFile)) {
        @unlink($lockFile);
    }
    return true;
}
開發者ID:sfsergey,項目名稱:knowledgetree,代碼行數:23,代碼來源:upgrade.php

示例6: tempnam

<?php

require_once "../../../config/dmsDefaults.php";
require_once KT_LIB_DIR . "/util/ktutil.inc";
$sSrc = KT_DIR . '/tests/util/ktutil/dataset1';
$name = tempnam('/tmp', 'deletedirectory');
unlink($name);
print "copying to {$name} first\n";
KTUtil::copyDirectory($sSrc, $name);
$name2 = tempnam($name, 'deletedirectory');
KTUtil::copyDirectory($sSrc, $name2);
var_dump($name);
var_dump($name2);
KTUtil::deleteDirectory($name);
開發者ID:5haman,項目名稱:knowledgetree,代碼行數:14,代碼來源:testDeleteDirectory.php

示例7: extractTextContent

 /**
  * The main context extraction function
  *
  * @return bool
  */
 public function extractTextContent()
 {
     $xml_content = $this->getOpenXmlContentTypes();
     if ($xml_content !== false) {
         $content = $this->getOpenXmlText($xml_content);
         if ($content !== false) {
             $result = file_put_contents($this->targetfile, $this->filter($content));
             if ($result === false) {
                 $this->output = _kt('Could not save content to file: ') . $this->targetfile;
                 KTUtil::deleteDirectory($this->openxml_dir);
                 return false;
             }
         }
         KTUtil::deleteDirectory($this->openxml_dir);
         return true;
     }
     KTUtil::deleteDirectory($this->openxml_dir);
     return false;
 }
開發者ID:sfsergey,項目名稱:knowledgetree,代碼行數:24,代碼來源:OpenXmlTextExtractor.inc.php


注:本文中的KTUtil::deleteDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。