Xpressengine\Storage\TempFileCreator::create PHP Method

create() public method

임시파일 생성
public create ( string $content ) : TempFile
$content string file content
return TempFile
    public function create($content)
    {
        $pathname = $this->getTempPathname();
        $fp = fopen($pathname, 'wb');
        fwrite($fp, $content);
        fclose($fp);
        return new TempFile($pathname);
    }

Usage Example

 /**
  * Extract file meta data
  *
  * @param Audio $audio audio file instance
  * @return array
  */
 protected function extractInformation(Audio $audio)
 {
     $tmpFile = $this->temp->create($audio->getContent());
     $info = $this->reader->analyze($tmpFile->getPathname());
     $tmpFile->destroy();
     if (isset($info['audio']['streams'])) {
         unset($info['audio']['streams']);
     }
     return [$info['audio'], $info['playtime_seconds'], $info['bitrate']];
 }
All Usage Examples Of Xpressengine\Storage\TempFileCreator::create