src/classes/CCConfig/File.php
public function read( $name )
	{
		// check for absolut path
		if ( substr( $name, 0, 1 ) == '/' && file_exists( $name ) ) 
		{
			return $this->read_file( $name );
		}
		
		$in_namespace = false;
		
		// split the namespace
		if ( strpos( $name, '::' ) !== false ) 
		{
			$conf = explode( '::', $name );
			$in_namespace = $conf[0];
			$name = $conf[1];
			unset( $conf );
		}
		
		// the two holders
		$main = $default = array();
		
		/*
		 * App config
		 * if app config try to load the equal core config as defaults
		 */
		if ( !$in_namespace ) 
		{
			$core_conf = $this->path( CCCORE_NAMESPACE.'::'.$name, true );
			$app_conf  = $this->path( $name, true );
			
			if ( file_exists( $core_conf ) ) 
			{
				$default = $this->read_file( $core_conf );
			}
			
			if ( file_exists( $app_conf ) ) 
			{
				$main = $this->read_file( $app_conf );
			}
		}
		/*
		 * Namespaced config
		 * means use the namespaced config as default also try to load the app implementation
		 */
		elseif ( $in_namespace ) 
		{
		
			$main_conf = $this->path( $in_namespace.'::'.$name, true );
			$app_conf = $this->path( $name, true );
		
			if ( file_exists( $main_conf ) ) 
			{
				$default = $this->read_file( $main_conf );
			}
			
			if ( file_exists( $app_conf ) ) 
			{
				$main = $this->read_file( $app_conf );
			}
		}
		
		// finally return the data
		return CCArr::merge( $default, $main );
	}
public function read( $name )
	{
		// check for absolut path
		if ( substr( $name, 0, 1 ) == '/' && file_exists( $name ) ) 
		{
			return $this->read_file( $name );
		}
		
		$in_namespace = false;
		
		// split the namespace
		if ( strpos( $name, '::' ) !== false ) 
		{
			$conf = explode( '::', $name );
			$in_namespace = $conf[0];
			$name = $conf[1];
			unset( $conf );
		}
		
		// the two holders
		$main = $default = array();
		
		/*
		 * App config
		 * if app config try to load the equal core config as defaults
		 */
		if ( !$in_namespace ) 
		{
			$core_conf = $this->path( CCCORE_NAMESPACE.'::'.$name, true );
			$app_conf  = $this->path( $name, true );
			
			if ( file_exists( $core_conf ) ) 
			{
				$default = $this->read_file( $core_conf );
			}
			
			if ( file_exists( $app_conf ) ) 
			{
				$main = $this->read_file( $app_conf );
			}
		}
		/*
		 * Namespaced config
		 * means use the namespaced config as default also try to load the app implementation
		 */
		elseif ( $in_namespace ) 
		{
		
			$main_conf = $this->path( $in_namespace.'::'.$name, true );
			$app_conf = $this->path( $name, true );
		
			if ( file_exists( $main_conf ) ) 
			{
				$default = $this->read_file( $main_conf );
			}
			
			if ( file_exists( $app_conf ) ) 
			{
				$main = $this->read_file( $app_conf );
			}
		}
		
		// finally return the data
		return CCArr::merge( $default, $main );
	}
public function read ( $ name ) { // check for absolut path if ( substr ( $ name , 0 , 1 ) == '/' && file_exists ( $ name ) ) { return $ this -> read_file ( $ name ) ; } $ in_namespace = false ; // split the namespace if ( strpos ( $ name , '::' ) !== false ) { $ conf = explode ( '::' , $ name ) ; $ in_namespace = $ conf [ 0 ] ; $ name = $ conf [ 1 ] ; unset ( $ conf ) ; } // the two holders $ main = $ default = array ( ) ; /*
		 * App config
		 * if app config try to load the equal core config as defaults
		 */ if ( ! $ in_namespace ) { $ core_conf = $ this -> path ( CCCORE_NAMESPACE . '::' . $ name , true ) ; $ app_conf = $ this -> path ( $ name , true ) ; if ( file_exists ( $ core_conf ) ) { $ default = $ this -> read_file ( $ core_conf ) ; } if ( file_exists ( $ app_conf ) ) { $ main = $ this -> read_file ( $ app_conf ) ; } } /*
		 * Namespaced config
		 * means use the namespaced config as default also try to load the app implementation
		 */ elseif ( $ in_namespace ) { $ main_conf = $ this -> path ( $ in_namespace . '::' . $ name , true ) ; $ app_conf = $ this -> path ( $ name , true ) ; if ( file_exists ( $ main_conf ) ) { $ default = $ this -> read_file ( $ main_conf ) ; } if ( file_exists ( $ app_conf ) ) { $ main = $ this -> read_file ( $ app_conf ) ; } } // finally return the data return CCArr :: merge ( $ default , $ main ) ; }
Read the configuration data
Get the configuration data and return them as array

@param string		$name
@return array
Read the configuration data Get the configuration data and return them as array