当前位置: 首页>>代码示例>>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;未经允许,请勿转载。