App-CELL

 view release on metacpan or  search on metacpan

lib/App/CELL.pm  view on Meta::CPAN


sub load {
    my $class = shift;
    my ( %ARGS ) = validate( @_, {
        enviro => { type => SCALAR, optional => 1 },
        sitedir => { type => SCALAR, optional => 1 },
        verbose => { type => SCALAR, default => 0 },
    } );
    my $status; 

    $log->info( "CELL version $VERSION called from " . (caller)[0] . 
                " with arguments " . stringify_args( \%ARGS ),
                cell => 1, suppress_caller => 1 );

    # we only get past this next call if at least the sharedir loads
    # successfully (sitedir is optional)
    $status = App::CELL::Load::init( %ARGS );
    return $status unless $status->ok;
    $log->info( "App::CELL has finished loading messages and site conf params", 
        cell => 1 ) if $meta->CELL_META_LOAD_VERBOSE;

lib/App/CELL/Config.pm  view on Meta::CPAN

            %ARGS = (   
                        %ARGS,
                        code => 'CELL_OVERWRITE_META_PARAM',
                        args => [ $param, ( defined( $value ) ? $value : 'undef' ) ],
                    );
            #$log->debug( "Overwriting \$meta->$param with ->$value<-", cell => 1 );
        } else {
            #$log->debug( "Setting new \$meta->$param to ->$value<-", cell => 1 );
        }
        $meta->{$param} = {
                               'File' => (caller)[1],
                               'Line' => (caller)[2],
                               'Value' => $value,
                          };
    } elsif ( $self->{'CELL_CONFTYPE'} eq 'core' ) {
        if ( exists $core->{$param} ) {
            %ARGS = (
                        %ARGS,
                        level => 'ERR',
                        code => 'CELL_PARAM_EXISTS_IMMUTABLE',
                        args => [ 'Core', $param ],
                    );
        } else {
            $core->{$param} = {
                                   'File' => (caller)[1],
                                   'Line' => (caller)[2],
                                   'Value' => $value,
                              };
        }
    } elsif ( $self->{'CELL_CONFTYPE'} eq 'site' ) {
        if ( exists $site->{$param} ) {
            %ARGS = (
                        %ARGS,
                        level => 'ERR',
                        code => 'CELL_PARAM_EXISTS_IMMUTABLE',
                        args => [ 'Site', $param ],
                    );
        } else {
            $site->{$param} = {
                                   'File' => (caller)[1],
                                   'Line' => (caller)[2],
                                   'Value' => $value,
                              };
        }
    }
    return App::CELL::Status->new( %ARGS );
}

# END OF App::CELL::Config MODULE
1;

lib/App/CELL/Load.pm  view on Meta::CPAN

    # determine verbosity level
    my $args_string;
    if ( %ARGS ) {
        $args_string = "with arguments: " . stringify_args( \%ARGS );
    } else {
        $args_string = "without arguments";
    }
    $meta->set('CELL_META_LOAD_VERBOSE', $ARGS{'verbose'} || 0);

    $log->info(
        "Entering App::CELL::Load::init from " . (caller)[0] . " $args_string",
        cell => 1
    ) if $meta->CELL_META_LOAD_VERBOSE;

    # check for taint mode
    if ( ${^TAINT} != 0 ) {
        return App::CELL::Status->new( level => "FATAL",
            code => "Attempt to load while in taint mode (-T)" );
    }

    # look up sharedir

lib/App/CELL/Message.pm  view on Meta::CPAN


=cut

sub new {

    my ( $class, %ARGS ) = @_; 
    my $stringified_args = stringify_args( \%ARGS );
    my $my_caller;
    my $msgobj = {};

    #$log->debug( "Entering Message->new called from " . (caller)[1] . " line " . (caller)[2]);
    if ( $ARGS{called_from_status} ) {
        $my_caller = $ARGS{caller};
    } else {
        $my_caller = [ CORE::caller() ];
    }
   
    if ( not exists( $ARGS{'code'} ) ) {
        return App::CELL::Status->new( level => 'ERR', 
            code => 'CELL_MESSAGE_NO_CODE', 
            caller => $my_caller,



( run in 3.241 seconds using v1.01-cache-2.11-cpan-8dfa8b56332 )