Evented-API-Engine
view release on metacpan or search on metacpan
lib/Evented/API/Engine.pm view on Meta::CPAN
}
# parse JSON. stop here if an error occurs, or if the manifest yields
# something other than a JSON object.
elsif (!($info = eval { $json->decode($slurp) }) || ref $info ne 'HASH') {
$api->Log($mod_name, "Load FAILED: JSON parsing of $path failed: $@");
$api->Debug($mod_name, "JSON text: $slurp");
return;
}
# JSON was decoded successfully at this point.
# developer mode is disabled, so return the manifest.
elsif (!$api->{developer}) {
$use_manifest++;
}
# JSON was decoded successfully, but we're in developer mode.
# check the modification times. only use the manifest if the module's
# main package has not been modified since the manifest was written.
else {
my $pkg_modified = (stat "$mod_dir/$mod_last_name.pm" )[9];
my $man_modified = (stat "$mod_dir/$mod_last_name.json")[9];
$use_manifest++ if $man_modified >= $pkg_modified;
}
# info was determined by JSON manifest.
if ($use_manifest) {
( run in 0.298 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )