本文整理汇总了PHP中KTUtil::moveDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP KTUtil::moveDirectory方法的具体用法?PHP KTUtil::moveDirectory怎么用?PHP KTUtil::moveDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KTUtil
的用法示例。
在下文中一共展示了KTUtil::moveDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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', 'movedirectory');
unlink($name);
print "copying to {$name} first\n";
KTUtil::copyDirectory($sSrc, $name);
$sSrc = $name;
$name = tempnam('/tmp', 'movedirectory');
unlink($name);
print "moving to {$name}\n";
KTUtil::moveDirectory($sSrc, $name);
示例2: moveFolder
function moveFolder($oFolder, $oDestFolder)
{
$table = "document_content_version";
$sQuery = "UPDATE {$table} SET storage_path = CONCAT(?, SUBSTRING(storage_path FROM ?)) WHERE storage_path LIKE ?";
if ($oDestFolder->getId() == 1) {
$sDestFolderPath = $oDestFolder->getName();
} else {
$sDestFolderPath = sprintf("%s/%s", $oDestFolder->getFullPath(), $oDestFolder->getName());
}
if ($oFolder->getId() == 1) {
$sSrcFolderPath = $oFolder->getName();
} else {
$sSrcFolderPath = sprintf("%s/%s", $oFolder->getFullPath(), $oFolder->getName());
}
$aParams = array($sDestFolderPath, strlen($oFolder->getFullPath()) + 1, sprintf("%s%%", $sSrcFolderPath));
$res = DBUtil::runQuery(array($sQuery, $aParams));
if (PEAR::isError($res)) {
return $res;
}
$oConfig =& KTConfig::getSingleton();
$sSrc = sprintf("%s/%s", $oConfig->get('urls/documentRoot'), $sSrcFolderPath);
$sDst = sprintf("%s/%s/%s", $oConfig->get('urls/documentRoot'), $sDestFolderPath, $oFolder->getName());
return KTUtil::moveDirectory($sSrc, $sDst);
}