Ignore:
Timestamp:
Apr 28, 2016, 8:05:36 PM (3 years ago)
Author:
bruno
Message:

First attempt to add a Mojolicious web app with swagger providing a RESTful API for pb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r2032 r2077  
    2929 
    3030our @ISA = qw(Exporter);
    31 our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_print pb_conf_get_all pb_conf_cache);
     31our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_print pb_conf_get_all pb_conf_get_hash pb_conf_cache);
    3232($VERSION,$REVISION) = pb_version_init();
    3333
     
    115115my $lh = shift;
    116116
    117 # Read the content of the config file and cache it in the %h hash further availble for queries
     117# Read the content of the config file and cache it in the %h hash then available for queries
    118118open(CONF,$cf) || confess "Unable to open $cf";
    119119while(<CONF>) {
    120120    next if (/^#/);
    121     if (/^\s*([A-z0-9-_.]+)\s+([[A-z0-9-_.]+)\s*=\s*(.*)$/) {
     121    if (/^\s*([A-z0-9-_.]+)\s+([[A-z0-9-_.\?\[\]\*\+\\]+)\s*=\s*(.*)$/) {
    122122        pb_log(3,"DEBUG: 1:$1 2:$2 3:$3\n");
    123123        $lh->{$1}->{$2}=$3;
     
    415415=item B<pb_conf_get_all>
    416416
    417 This function returns an array wirh all configuration parameters
     417This function returns an array with all configuration parameters
    418418
    419419=cut
     
    422422
    423423return(sort keys %$h);
     424}
     425
     426
     427=item B<pb_conf_get_hash>
     428
     429This function returns a pointer to the hash with all configuration parameters
     430
     431=cut
     432
     433sub pb_conf_get_hash {
     434
     435return($h);
    424436}
    425437
Note: See TracChangeset for help on using the changeset viewer.