function load_conf( $confpath ){
		if( ! PLUGTool::check_file($confpath) ){
			throw new PLUGException('bad conf');
		}
		$e = PLUG::exec_bin( 'parseconf', array($confpath), $s );
		if( $e ){
			trigger_error('Failed to parse '.basename($confpath), E_USER_NOTICE );
			return false;
		}
		$a = unserialize( $s );
		if( ! is_array($a) ){
			trigger_error( "parseconf returned bad serialize string, $s", E_USER_WARNING );
			return false;
		}
		$this->conf_vars = array_merge( $this->conf_vars, $a[0] );
		$this->conf_consts = array_merge( $this->conf_consts, $a[1] );
		return true;
	}
function load_conf( $confpath ){
		if( ! PLUGTool::check_file($confpath) ){
			throw new PLUGException('bad conf');
		}
		$e = PLUG::exec_bin( 'parseconf', array($confpath), $s );
		if( $e ){
			trigger_error('Failed to parse '.basename($confpath), E_USER_NOTICE );
			return false;
		}
		$a = unserialize( $s );
		if( ! is_array($a) ){
			trigger_error( "parseconf returned bad serialize string, $s", E_USER_WARNING );
			return false;
		}
		$this->conf_vars = array_merge( $this->conf_vars, $a[0] );
		$this->conf_consts = array_merge( $this->conf_consts, $a[1] );
		return true;
	}
function load_conf ( $ confpath ) { if ( ! PLUGTool :: check_file ( $ confpath ) ) { throw new PLUGException ( 'bad conf' ) ; } $ e = PLUG :: exec_bin ( 'parseconf' , array ( $ confpath ) , $ s ) ; if ( $ e ) { trigger_error ( 'Failed to parse ' . basename ( $ confpath ) , E_USER_NOTICE ) ; return false ; } $ a = unserialize ( $ s ) ; if ( ! is_array ( $ a ) ) { trigger_error ( "parseconf returned bad serialize string, $s" , E_USER_WARNING ) ; return false ; } $ this -> conf_vars = array_merge ( $ this -> conf_vars , $ a [ 0 ] ) ; $ this -> conf_consts = array_merge ( $ this -> conf_consts , $ a [ 1 ] ) ; return true ; }
Parse a given config file and merge values into registry.
Currenly only constants in configs are supported by this compiler.
@todo should be parse variables, or just constants?
@todo use native parser rather than shell out?
@param string path to config file
@return bool
Parse a given config file and merge values into registry . Currenly only constants in configs are supported by this compiler .