src/WPConfigTransformer.php
public function exists( $type, $name ) {
		$wp_config_src = file_get_contents( $this->wp_config_path );

		if ( ! trim( $wp_config_src ) ) {
			throw new Exception( 'Config file is empty.' );
		}
		// Normalize the newline to prevent an issue coming from OSX.
		$this->wp_config_src = str_replace( array( "\n\r", "\r" ), "\n", $wp_config_src );
		$this->wp_configs    = $this->parse_wp_config( $this->wp_config_src );

		if ( ! isset( $this->wp_configs[ $type ] ) ) {
			throw new Exception( "Config type '{$type}' does not exist." );
		}

		return isset( $this->wp_configs[ $type ][ $name ] );
	}
public function exists( $type, $name ) {
		$wp_config_src = file_get_contents( $this->wp_config_path );

		if ( ! trim( $wp_config_src ) ) {
			throw new Exception( 'Config file is empty.' );
		}
		// Normalize the newline to prevent an issue coming from OSX.
		$this->wp_config_src = str_replace( array( "\n\r", "\r" ), "\n", $wp_config_src );
		$this->wp_configs    = $this->parse_wp_config( $this->wp_config_src );

		if ( ! isset( $this->wp_configs[ $type ] ) ) {
			throw new Exception( "Config type '{$type}' does not exist." );
		}

		return isset( $this->wp_configs[ $type ][ $name ] );
	}
public function exists ( $ type , $ name ) { $ wp_config_src = file_get_contents ( $ this -> wp_config_path ) ; if ( ! trim ( $ wp_config_src ) ) { throw new Exception ( 'Config file is empty.' ) ; } // Normalize the newline to prevent an issue coming from OSX. $ this -> wp_config_src = str_replace ( array ( "\n\r" , "\r" ) , "\n" , $ wp_config_src ) ; $ this -> wp_configs = $ this -> parse_wp_config ( $ this -> wp_config_src ) ; if ( ! isset ( $ this -> wp_configs [ $ type ] ) ) { throw new Exception ( "Config type '{$type}' does not exist." ) ; } return isset ( $ this -> wp_configs [ $ type ] [ $ name ] ) ; }
Checks if a config exists in the wp-config.php file.

@throws Exception If the wp-config.php file is empty.
@throws Exception If the requested config type is invalid.

@param string $type Config type (constant or variable).
@param string $name Config name.

@return bool
Checks if a config exists in the wp - config . php file .