You are here

public function DrupalLocalStreamWrapper::stream_cast in Drupal 7

Retrieve the underlying stream resource.

This method is called in response to stream_select().

@link http://php.net/manual/streamwrapper.stream-cast.php

Parameters

int $cast_as: Can be STREAM_CAST_FOR_SELECT when stream_select() is calling stream_cast() or STREAM_CAST_AS_STREAM when stream_cast() is called for other uses.

Return value

resource|false The underlying stream resource or FALSE if stream_select() is not supported.

See also

stream_select()

File

includes/stream_wrappers.inc, line 655
Drupal stream wrapper interface.

Class

DrupalLocalStreamWrapper
Drupal stream wrapper base class for local files.

Code

public function stream_cast($cast_as) {
  return $this->handle ? $this->handle : FALSE;
}