示例#1
0
文件: Link.php 项目: Hywan/File
 /**
  * Open a link.
  *
  * @access  public
  * @param   string  $streamName    Stream name.
  * @param   string  $mode          Open mode, see the parent::MODE_*
  *                                 constants.
  * @param   string  $context       Context ID (please, see the
  *                                 \Hoa\Stream\Context class).
  * @param   bool    $wait          Differ opening or not.
  * @return  void
  * @throw   \Hoa\File\Exception
  */
 public function __construct($streamName, $mode, $context = null, $wait = false)
 {
     if (!is_link($streamName)) {
         throw new \Hoa\File\Exception('File %s is not a link.', 0, $streamName);
     }
     parent::__construct($streamName, $mode, $context, $wait);
     return;
 }
示例#2
0
 /**
  * Open a temporary file.
  *
  * @param   string  $streamName    Stream name (or file descriptor).
  * @param   string  $mode          Open mode, see the parent::MODE_*
  *                                 constants.
  * @param   string  $context       Context ID (please, see the
  *                                 \Hoa\Stream\Context class).
  * @param   bool    $wait          Differ opening or not.
  * @return  void
  */
 public function __construct($streamName, $mode, $context = null, $wait = false)
 {
     if (null === $streamName) {
         $streamName = 'hoa://Library/File/Temporary.php#' . self::$_i++;
     }
     parent::__construct($streamName, $mode, $context, $wait);
     return;
 }