当前位置: 首页>>代码示例>>PHP>>正文


PHP ezcMailParser::getTmpDir方法代码示例

本文整理汇总了PHP中ezcMailParser::getTmpDir方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcMailParser::getTmpDir方法的具体用法?PHP ezcMailParser::getTmpDir怎么用?PHP ezcMailParser::getTmpDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ezcMailParser的用法示例。


在下文中一共展示了ezcMailParser::getTmpDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: openFile

 /**
  * Returns the filepointer of the opened file $fileName in a unique directory..
  *
  * This method will create a new unique folder in the temporary directory specified in ezcMailParser.
  * The fileName property of this class will be set to the location of the new file.
  *
  * @throws ezcBaseFileNotFoundException
  *         if the file could not be opened.
  * @param string $fileName
  * @return resource
  */
 private function openFile($fileName)
 {
     // The filename is now relative, we need to extend it with the absolute path.
     // To provide uniqueness we put the file in a directory based on processID and rand.
     $dirName = ezcMailParser::getTmpDir() . getmypid() . '-' . self::$counter++ . '/';
     if (!is_dir($dirName)) {
         mkdir($dirName, 0700);
     }
     // remove the directory and the file when PHP shuts down
     ezcMailParserShutdownHandler::registerForRemoval($dirName);
     $this->fileName = $dirName . $fileName;
     $fp = fopen($this->fileName, 'w');
     if ($this->fp === false) {
         throw new ezcBaseFileNotFoundException($this->fileName);
     }
     return $fp;
 }
开发者ID:kidaa30,项目名称:yes,代码行数:28,代码来源:file_parser.php

示例2: testTempDirNonWindows

 /**
  * Test for bug #12844.
  */
 public function testTempDirNonWindows()
 {
     if (ezcBaseFeatures::os() === 'Windows') {
         self::markTestSkipped('Test is for non-Windows only');
     }
     ezcMailParser::setTmpDir(null);
     $this->assertEquals('/tmp/', ezcMailParser::getTmpDir());
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:11,代码来源:parser_test.php


注:本文中的ezcMailParser::getTmpDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。