| 1 file_example_session_streams.inc | public FileExampleSessionStreamWrapper::rename($from_uri, $to_uri) | 
        
Support for rename().
Parameters
string $from_uri: The uri to the file to rename.
string $to_uri: The new uri for file.
Return value
bool: TRUE if file was successfully renamed.
Overrides StreamWrapperInterface::rename
See also
http://php.net/manual/en/streamwrapper.rename.php
File
- modules/
examples/ file_example/ file_example_session_streams.inc, line 483  - Provides a demonstration session:// stream-wrapper.
 
Class
- FileExampleSessionStreamWrapper
 - Example stream wrapper class to handle session:// streams.
 
Code
public function rename($from_uri, $to_uri) {
  $from_key = &$this->uri_to_session_key($from_uri);
  $to_key = &$this->uri_to_session_key($to_uri);
  if (is_dir($to_key) || is_file($to_key)) {
    return FALSE;
  }
  $to_key = $from_key;
  unset($from_key);
  return TRUE;
}