Line 0
Link Here
|
0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
use Time::HiRes qw(gettimeofday); |
3 |
use C4::Installer; |
4 |
use C4::Languages qw(getAllLanguages getTranslatedLanguages); |
5 |
use C4::Context; |
6 |
|
7 |
my $file_type = $ARGV[0] || 'yml'; |
8 |
my $installer = C4::Installer->new(); |
9 |
|
10 |
$installer->load_db_schema; |
11 |
my $all_languages = getAllLanguages(); |
12 |
my @file_list = qw( |
13 |
installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.yml |
14 |
installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml |
15 |
installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.yml |
16 |
installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.yml |
17 |
installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.yml |
18 |
installer/data/mysql/en/mandatory/auth_values.yml |
19 |
installer/data/mysql/en/mandatory/class_sources.yml |
20 |
installer/data/mysql/en/mandatory/sample_frequencies.yml |
21 |
installer/data/mysql/en/mandatory/sample_notices.yml |
22 |
installer/data/mysql/en/mandatory/sample_numberpatterns.yml |
23 |
installer/data/mysql/en/optional/auth_val.yml |
24 |
installer/data/mysql/en/optional/csv_profiles.yml |
25 |
installer/data/mysql/en/optional/marc21_holdings_coded_values.yml |
26 |
installer/data/mysql/en/optional/marc21_relatorterms.yml |
27 |
installer/data/mysql/en/optional/parameters.yml |
28 |
installer/data/mysql/en/optional/patron_atributes.yml |
29 |
installer/data/mysql/en/optional/patron_categories.yml |
30 |
installer/data/mysql/en/optional/sample_creator_data.yml |
31 |
installer/data/mysql/en/optional/sample_itemtypes.yml |
32 |
installer/data/mysql/en/optional/sample_libraries.yml |
33 |
installer/data/mysql/en/optional/sample_libraries_holidays.yml |
34 |
installer/data/mysql/en/optional/sample_news.yml |
35 |
installer/data/mysql/en/optional/sample_patrons.yml |
36 |
installer/data/mysql/en/optional/sample_quotes.yml |
37 |
installer/data/mysql/en/optional/sample_z3950_servers.yml |
38 |
); |
39 |
|
40 |
map { s/.yml$/.sql/ } @file_list if $file_type eq 'sql'; |
41 |
|
42 |
$installer->load_sql_in_order( $all_languages ); |
43 |
my $begin_all = gettimeofday; |
44 |
for my $sql ( @file_list ) { |
45 |
my $before = gettimeofday; |
46 |
$installer->load_sql($sql); |
47 |
my $after = gettimeofday; |
48 |
say sprintf "%.2f - %s", $after - $before, $sql; |
49 |
} |
50 |
my $end_all = gettimeofday; |
51 |
say sprintf "TOTAL = %.2f", $end_all - $begin_all; |