__construct() that will create a temporary * file that will be destroy when calling the $this->close() method. * * @param string $directory Directory where the temporary filename * will be created. If the directory does not * exist, it may generate a file in the * system's temporary directory. * @param string $prefix Prefix of the generated temporary * filename. * @return string */ public static function create($directory = null, $prefix = '__hoa_') { if (null === $directory || false === is_dir($directory)) { $directory = static::getTemporaryDirectory(); } return tempnam($directory, $prefix); } /** * Get the directory path used for temporary files. * * @return string */ public static function getTemporaryDirectory() { return sys_get_temp_dir(); } } /** * Flex entity. */ Consistency::flexEntity('Hoa\File\Temporary\Temporary');