' . PHP_EOL ) ) { // phpcs:ignore Alert_Manager::log_error( 'Could not initialize request log file', array( 'file' => $file, ) ); return; } $f = fopen( $file, 'a' ); if ( $f ) { if ( ! fwrite( $f, $line ) ) { Alert_Manager::log_warn( 'Could not write to log file', array( 'file' => $file, ) ); } if ( ! fclose( $f ) ) { Alert_Manager::log_warn( 'Could not close log file', array( 'file' => $file, ) ); } } else { Alert_Manager::log_warn( 'Could not open log file', array( 'file' => $file, ) ); } } /** * Sets $envvars element with key and value. * * @param mixed $name - Key name of the variable. * @param mixed $value - Value of the variable. */ public static function set_var( $name, $value ) { self::$env_vars[ $name ] = $value; } /** * Copy data array into $envvars array. * * @param array $data - Data array. */ public static function set_vars( $data ) { foreach ( $data as $name => $value ) { self::set_var( $name, $value ); } } } }