, where schema data will be cached. Ignored if schema_cache_policy is NONE. The file will be in JSON format. No default provided.
=back
=cut
sub get_global_option {
my $inv = shift;
my $
se Carp;
use Class::ReluctantORM::Utilities qw(conditional_load_subdir read_file write_file json_encode json_decode);
our @POLICY_CLASSES;
BEGIN {
@POLICY_CLASSES = conditional_load_subdir(__PACK
= json_decode($raw);
}
sub write_cache_file {
my $self = shift;
my $filename = Class::ReluctantORM->get_global_option('schema_cache_file');
return unless $filename;
my $raw = json_e
XPORT_TAGS = ();
use Class::ReluctantORM::Exception;
use Lingua::EN::Inflect;
use Sub::Name;
use JSON;
our $DEBUG = 0;
=head1 SUBROUTINES
=cut
=head2 install_method('Class', 'method_name', $code
=head2 $json_string = json_encode($perl_ref);
Version-blind JSON encoder.
=cut
push @EXPORT_OK, 'json_encode';
sub json_encode {
if ($JSON::VERSION > 2) {
goto &JSON::to_json;
} e
goto &JSON::objToJson;
}
}
=head2 $perl_ref = json_decode($json_string);
Version-blind JSON decoder.
=cut
push @EXPORT_OK, 'json_decode';
sub json_decode {
if ($JSON::VERSION > 2)