public function Dump () {
		$environment = static::GetEnvironment(TRUE);
		list($sections, $envSpecifics) = $this->dumpSectionsInfo();
		$levelKey = '';
		$basicData = [];
		$sectionsData = [];
		foreach ($this->data as $key => & $value) {
			if (is_object($value) || is_array($value)) {
				if ($sectionsData) $sectionsData[] = '';
				$sectionType = isset($sections[$key]) ? $sections[$key] : 0;
				$environmentSpecificSection = $sectionType === 3;
				if ($sectionType) {
					unset($sections[$key]);
					$sectionsData[] = ($environmentSpecificSection 
						? '[' . $environment . ' > ' . $key . ']'
						: '[' . $key . ']');
					$levelKey = '';
				} else {
					$levelKey = (string) $key;
				}
				$this->dumpRecursive($levelKey, $value, $sectionsData);
				if ($environmentSpecificSection && isset($envSpecifics[$key])) {
					foreach ($envSpecifics[$key] as $envName => $sectionLines) {
						if ($envName === $environment) continue;
						$sectionsData[] = '';
						foreach ($sectionLines as $sectionLine)
							$sectionsData[] = $sectionLine;
					}
				}
			} else {
				$basicData[] = $key . ' = ' . $this->dumpScalarValue($value);
			}
		}
		$result = '';
		if ($basicData) $result = implode(PHP_EOL, $basicData);
		if ($sectionsData) $result .= PHP_EOL . PHP_EOL . implode(PHP_EOL, $sectionsData);
		return $result;
	}
public function Dump () {
		$environment = static::GetEnvironment(TRUE);
		list($sections, $envSpecifics) = $this->dumpSectionsInfo();
		$levelKey = '';
		$basicData = [];
		$sectionsData = [];
		foreach ($this->data as $key => & $value) {
			if (is_object($value) || is_array($value)) {
				if ($sectionsData) $sectionsData[] = '';
				$sectionType = isset($sections[$key]) ? $sections[$key] : 0;
				$environmentSpecificSection = $sectionType === 3;
				if ($sectionType) {
					unset($sections[$key]);
					$sectionsData[] = ($environmentSpecificSection 
						? '[' . $environment . ' > ' . $key . ']'
						: '[' . $key . ']');
					$levelKey = '';
				} else {
					$levelKey = (string) $key;
				}
				$this->dumpRecursive($levelKey, $value, $sectionsData);
				if ($environmentSpecificSection && isset($envSpecifics[$key])) {
					foreach ($envSpecifics[$key] as $envName => $sectionLines) {
						if ($envName === $environment) continue;
						$sectionsData[] = '';
						foreach ($sectionLines as $sectionLine)
							$sectionsData[] = $sectionLine;
					}
				}
			} else {
				$basicData[] = $key . ' = ' . $this->dumpScalarValue($value);
			}
		}
		$result = '';
		if ($basicData) $result = implode(PHP_EOL, $basicData);
		if ($sectionsData) $result .= PHP_EOL . PHP_EOL . implode(PHP_EOL, $sectionsData);
		return $result;
	}
public function Dump ( ) { $ environment = static :: GetEnvironment ( TRUE ) ; list ( $ sections , $ envSpecifics ) = $ this -> dumpSectionsInfo ( ) ; $ levelKey = '' ; $ basicData = [ ] ; $ sectionsData = [ ] ; foreach ( $ this -> data as $ key => & $ value ) { if ( is_object ( $ value ) || is_array ( $ value ) ) { if ( $ sectionsData ) $ sectionsData [ ] = '' ; $ sectionType = isset ( $ sections [ $ key ] ) ? $ sections [ $ key ] : 0 ; $ environmentSpecificSection = $ sectionType === 3 ; if ( $ sectionType ) { unset ( $ sections [ $ key ] ) ; $ sectionsData [ ] = ( $ environmentSpecificSection ? '[' . $ environment . ' > ' . $ key . ']' : '[' . $ key . ']' ) ; $ levelKey = '' ; } else { $ levelKey = ( string ) $ key ; } $ this -> dumpRecursive ( $ levelKey , $ value , $ sectionsData ) ; if ( $ environmentSpecificSection && isset ( $ envSpecifics [ $ key ] ) ) { foreach ( $ envSpecifics [ $ key ] as $ envName => $ sectionLines ) { if ( $ envName === $ environment ) continue ; $ sectionsData [ ] = '' ; foreach ( $ sectionLines as $ sectionLine ) $ sectionsData [ ] = $ sectionLine ; } } } else { $ basicData [ ] = $ key . ' = ' . $ this -> dumpScalarValue ( $ value ) ; } } $ result = '' ; if ( $ basicData ) $ result = implode ( PHP_EOL , $ basicData ) ; if ( $ sectionsData ) $ result .= PHP_EOL . PHP_EOL . implode ( PHP_EOL , $ sectionsData ) ; return $ result ; }
Dump configuration data in INI syntax with originally loaded sections and
environment dependency support. This method try to load original INI file
if exists and creates INI sections by original file. Or all data are
rendered in plain structure without any section. If there is in original
config file any section for different environment, this method dumps that
section content immediately after current environment section, so all
data for different environment stays there.
@return string
Dump configuration data in INI syntax with originally loaded sections and environment dependency support . This method try to load original INI file if exists and creates INI sections by original file . Or all data are rendered in plain structure without any section . If there is in original config file any section for different environment this method dumps that section content immediately after current environment section so all data for different environment stays there .