public static function loadProfile($profile)
    {
        $decoded = json_decode(file_get_contents($profile));
        if (!empty($decoded->code)) {
            $decoded->code = str_replace(array('-', '.'), array('_', '_'), $decoded->code);
        } else {
            throw new InvalidProfileException("Error getting 'code' from profile {$profile}", E_USER_ERROR);
        }
        return $decoded;
    }
public static function loadProfile($profile)
    {
        $decoded = json_decode(file_get_contents($profile));
        if (!empty($decoded->code)) {
            $decoded->code = str_replace(array('-', '.'), array('_', '_'), $decoded->code);
        } else {
            throw new InvalidProfileException("Error getting 'code' from profile {$profile}", E_USER_ERROR);
        }
        return $decoded;
    }
public static function loadProfile ( $ profile ) { $ decoded = json_decode ( file_get_contents ( $ profile ) ) ; if ( ! empty ( $ decoded -> code ) ) { $ decoded -> code = str_replace ( array ( '-' , '.' ) , array ( '_' , '_' ) , $ decoded -> code ) ; } else { throw new InvalidProfileException ( "Error getting 'code' from profile {$profile}" , E_USER_ERROR ) ; } return $ decoded ; }
Load JSON profile data into a PHP stdObject instance.

@param string $profile A valid stream or file location for the profile.

@throws InvalidProfileException If a valid code cannot be found in the
profile.
@return \stdClass A stdObject representation of the JSON profile data.
Load JSON profile data into a PHP stdObject instance .