Skip to content

Advanced Guide

Nana Axel edited this page Sep 6, 2019 · 10 revisions

Summary


WaterPipe configuration

If you want, you can customize the behaviour of WaterPipe using the WaterPipeConfig class. Available options are:

  • queryStringEnabled: This option is a boolean defining if the use of query strings are enabled in your pipes. The default value is true ;
  • defaultCharset: This option is a string defining the default charset to use when processing responses. The default value is "utf-8" ;
  • useStdrr: This option is a boolean defining if WaterPipe have to use the STDERR output channel to print errors and uncaught exceptions. The default value is true .

To configure WaterPipe, you just have to retrieve the singleton and define values, before creating pipes.

<?php

use \ElementaryFramework\WaterPipe\WaterPipeConfig;

// Edit configuration
$config = WaterPipeConfig::get();
$config->setUseStderr(false);
$config->setDefaultCharset("ISO-8859-1");

// You can now create your pipes...
Clone this wiki locally