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


PHP Folder::getFolderPath方法代碼示例

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


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

示例1: getPhoto

 public function getPhoto(Folder $folder, $filename)
 {
     $photoPath = $folder->getFolderPath() . DS . $filename;
     if (array_key_exists($photoPath, $this->photos)) {
         return $this->photos[$photoPath];
     }
     $photo = new Photo($folder, $filename);
     $this->photos[$photoPath] = $photo;
     return $photo;
 }
開發者ID:beingsane,項目名稱:joomla-gallery,代碼行數:10,代碼來源:filesystem.php

示例2: getPath

 /**
  * Get the full path for a document
  *
  * @return string full path of document
  */
 function getPath()
 {
     return Folder::getFolderPath($this->iFolderId) . $this->sFileName;
 }
開發者ID:5haman,項目名稱:knowledgetree,代碼行數:9,代碼來源:documentcore.inc.php

示例3: deleteVersion

 /**
  * Delete a selected version of the document.
  */
 function deleteVersion($oDocument, $iVersionID, $sReason)
 {
     $oDocument =& KTUtil::getObject('Document', $oDocument);
     $oVersion =& KTDocumentMetadataVersion::get($iVersionID);
     $oStorageManager =& KTStorageManagerUtil::getSingleton();
     global $default;
     if (empty($sReason)) {
         return PEAR::raiseError(_kt('Deletion requires a reason'));
     }
     if (PEAR::isError($oDocument) || $oDocument == false) {
         return PEAR::raiseError(_kt('Invalid document object.'));
     }
     if (PEAR::isError($oVersion) || $oVersion == false) {
         return PEAR::raiseError(_kt('Invalid document version object.'));
     }
     $iContentId = $oVersion->getContentVersionId();
     $oContentVersion = KTDocumentContentVersion::get($iContentId);
     if (PEAR::isError($oContentVersion) || $oContentVersion == false) {
         return PEAR::raiseError(_kt('Invalid document content version object.'));
     }
     // Check that the document content is not the same as the current content version
     $sDocStoragePath = $oDocument->getStoragePath();
     $sVersionStoragePath = $oContentVersion->getStoragePath();
     if ($sDocStoragePath == $sVersionStoragePath) {
         return PEAR::raiseError(_kt("Can't delete version: content is the same as the current document content."));
     }
     DBUtil::startTransaction();
     // now delete the document version
     $res = $oStorageManager->deleteVersion($oVersion);
     if (PEAR::isError($res) || $res == false) {
         //could not delete the document version from the file system
         $default->log->error('Deletion: Filesystem error deleting the metadata version ' . $oVersion->getMetadataVersion() . ' of the document ' . $oDocument->getFileName() . ' from folder ' . Folder::getFolderPath($oDocument->getFolderID()) . ' id=' . $oDocument->getFolderID());
         // we use a _real_ transaction here ...
         DBUtil::rollback();
         return PEAR::raiseError(_kt('There was a problem deleting the document from storage.'));
     }
     // change status for the metadata version
     $oVersion->setStatusId(VERSION_DELETED);
     $oVersion->update();
     // set the storage path to empty
     //        $oContentVersion->setStoragePath('');
     DBUtil::commit();
 }
開發者ID:sfsergey,項目名稱:knowledgetree,代碼行數:46,代碼來源:documentutil.inc.php


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