GuzzleHttpPsr7try_fopen

Safely opens a PHP stream resource using a filename.

Description

(resource) GuzzleHttp\Psr7\try_fopen( (string) $filename, (string) $mode ); 

When fopen fails, PHP normally raises a warning. This function adds an error handler that checks for errors and throws an exception instead.

Returns (resource)

Parameters (2)

0. $filename (string)
The filename.
1. $mode (string)
Mode used to open the file

Usage

  1. if ( !function_exists( 'GuzzleHttp\Psr7\try_fopen' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'w3-total-cache/lib/Azure/GuzzleHttp/Psr7/functions.php'; 
  3.  
  4. // The filename. 
  5. $filename = ''; 
  6.  
  7. // Mode used to open the file 
  8. $mode = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = GuzzleHttp\Psr7\try_fopen($filename, $mode); 
  12.  

Defined (1)

The function is defined in the following location(s).

/lib/Azure/GuzzleHttp/Psr7/functions.php