Articulate
view release on metacpan or search on metacpan
lib/Articulate/Role/Storage.pm view on Meta::CPAN
};
around delete_item => sub {
my ( $orig, $self ) = ( shift, shift );
my $return = $self->$orig(@_);
$self->caching->clear_cache( meta => $_[0] );
$self->caching->clear_cache( content => $_[0] );
# what about children?
# Three possible approaches:
# 1. clear cache of anything that looks le it might be a child
# 2. storage deletion should recursively delete for all children
# 3. storage should return an arrayref of items it deleted
return $return;
};
around empty_all_content => sub {
my ( $orig, $self ) = ( shift, shift );
my $return = $self->$orig(@_);
$self->caching->empty_cache();
return $return;
lib/Articulate/Storage/Local.pm view on Meta::CPAN
Removes all content. This is totally irreversible, unless you took a
backup!
=cut
sub empty_all_content {
my $self = shift;
my $true_location = $self->content_base;
throw_error Internal => "Won't empty all content, this looks too dangerous"
if ( -d "$true_location/.git"
or -f "$true_location/Makefile.PL" );
File::Path::remove_tree( $self->content_base, { keep_root => 1 } );
}
=head3 delete_item
$storage->delete_item ('/zone/public');
lib/Articulate/Syntax.pm view on Meta::CPAN
return $original->instance();
}
else {
return $original->new();
}
}
elsif ( ref $original eq ref {} ) {
my $class = $original->{class};
my $args = $original->{args};
if ( 1 == keys %$original and join( '', keys %$original ) !~ /^[a-z_]/ )
{ # single key that looks like a class
$class = join '', keys %$original;
$args = $original->{$class};
}
throw_error Internal => 'Instantiation failed: expecting key class, got '
. ( join ', ', keys %$original )
unless defined $class;
Module::Load::load($class);
my $constructor = $original->{constructor}
// ( $class->can('instance') ? 'instance' : 'new' );
my @args = (
( run in 1.198 second using v1.01-cache-2.11-cpan-64827b87656 )