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


PHP CTempFile::GetAbsoluteRoot方法代碼示例

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


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

示例1: ResizeImageDeleteCache

 function ResizeImageDeleteCache($arFile)
 {
     $temp_dir = CTempFile::GetAbsoluteRoot() . "/";
     if (strpos($arFile["tmp_name"], $temp_dir) === 0) {
         if (file_exists($arFile["tmp_name"])) {
             unlink($arFile["tmp_name"]);
         }
     }
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:9,代碼來源:file.php

示例2: makeFileArrayFromArray

 private static function makeFileArrayFromArray($file_array, $description = null, $options = array())
 {
     $result = false;
     if (is_uploaded_file($file_array["tmp_name"])) {
         $result = $file_array;
         if (!is_null($description)) {
             $result["description"] = $description;
         }
     } elseif (strlen($file_array["tmp_name"]) > 0 && strpos($file_array["tmp_name"], CTempFile::GetAbsoluteRoot()) === 0) {
         $io = CBXVirtualIo::GetInstance();
         $absPath = $io->CombinePath("/", $file_array["tmp_name"]);
         $tmpPath = CTempFile::GetAbsoluteRoot() . "/";
         if (strpos($absPath, $tmpPath) === 0) {
             $result = $file_array;
             $result["tmp_name"] = $absPath;
             $result["error"] = intval($result["error"]);
             if (!is_null($description)) {
                 $result["description"] = $description;
             }
         }
     } elseif (strlen($file_array["tmp_name"]) > 0) {
         $io = CBXVirtualIo::GetInstance();
         $normPath = $io->CombinePath("/", $file_array["tmp_name"]);
         $absPath = $io->CombinePath($_SERVER["DOCUMENT_ROOT"], $normPath);
         $tmpPath = CTempFile::GetAbsoluteRoot() . "/";
         if (strpos($absPath, $tmpPath) === 0) {
             $result = $file_array;
             $result["tmp_name"] = $absPath;
             $result["error"] = intval($result["error"]);
             if (!is_null($description)) {
                 $result["description"] = $description;
             }
         }
     } else {
         $emptyFile = array("name" => null, "type" => null, "tmp_name" => null, "error" => 4, "size" => 0);
         if ($file_array == $emptyFile) {
             $result = $emptyFile;
             if (!is_null($description)) {
                 $result["description"] = $description;
             }
         }
     }
     return $result;
 }
開發者ID:andy-profi,項目名稱:bxApiDocs,代碼行數:44,代碼來源:iblock.php

示例3: Unlock

 public static function Unlock()
 {
     $lock_filename = CTempFile::GetAbsoluteRoot() . '/sharepoint.lock.txt';
     if (file_exists($lock_filename)) {
         @unlink($lock_filename);
     }
     return true;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:8,代碼來源:sharepoint_queue.php

示例4: SetOption

 public static function SetOption($name = '', $value = false, $serialize = true)
 {
     if ($serialize) {
         $value = serialize($value);
     }
     $abs_path = CTempFile::GetAbsoluteRoot() . "/cal_convert/" . $name . ".tmp";
     $io = CBXVirtualIo::GetInstance();
     $fileIo = $io->GetFile($abs_path);
     $io->CreateDirectory($fileIo->GetPath());
     $f = fopen($abs_path, "wb");
     fwrite($f, $value);
     fclose($f);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:13,代碼來源:calendar_convert.php

示例5: generatePath

 protected static function generatePath()
 {
     $tmpName = md5(mt_rand() . mt_rand());
     $dir = rtrim(CTempFile::GetDirectoryName(2, 'webdav'), '/') . '/';
     CheckDirPath($dir);
     //make folder recursive
     $pathItems = explode(CTempFile::GetAbsoluteRoot(), $dir . $tmpName);
     return array(array_pop($pathItems), $tmpName);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:9,代碼來源:webdavtmpfile.php

示例6: checkBitrixTempPath

 /**
  * Check Bitrix temporary directory path.
  *
  * @since 15.5.4
  * @return string
  */
 protected function checkBitrixTempPath()
 {
     $io = CBXVirtualIo::GetInstance();
     $path = CTempFile::GetAbsoluteRoot();
     $path = $io->CombinePath($path);
     $documentRoot = self::getParam("DOCUMENT_ROOT", $_SERVER["DOCUMENT_ROOT"]);
     $documentRoot = $io->CombinePath($documentRoot);
     if (strpos($path, $documentRoot) === 0) {
         $this->addUnformattedDetailError("SECURITY_SITE_CHECKER_BITRIX_TMP_DIR", CSecurityCriticalLevel::MIDDLE, getMessage("SECURITY_SITE_CHECKER_BITRIX_TMP_DIR_ADDITIONAL", array("#DIR#" => $path)));
         return static::STATUS_FAILED;
     }
     return static::STATUS_PASSED;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:19,代碼來源:environment.php


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