forked from Azure/Moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper_functions.sh
1747 lines (1589 loc) · 45.5 KB
/
helper_functions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
# Common functions definitions
function install_php_sql_driver
{
# Download and build php/mssql driver
/usr/bin/curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
/usr/bin/curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql mssql-tools unixodbc-dev -y
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
#Build mssql driver
/usr/bin/pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system
/usr/bin/pecl install sqlsrv
/usr/bin/pecl install pdo_sqlsrv
PHPVER=`/usr/bin/php -r "echo PHP_VERSION;" | /usr/bin/cut -c 1,2,3`
echo "extension=sqlsrv.so" >> /etc/php/$PHPVER/fpm/php.ini
echo "extension=pdo_sqlsrv.so" >> /etc/php/$PHPVER/fpm/php.ini
echo "extension=sqlsrv.so" >> /etc/php/$PHPVER/apache2/php.ini
echo "extension=pdo_sqlsrv.so" >> /etc/php/$PHPVER/apache2/php.ini
echo "extension=sqlsrv.so" >> /etc/php/$PHPVER/cli/php.ini
echo "extension=pdo_sqlsrv.so" >> /etc/php/$PHPVER/cli/php.ini
}
function check_fileServerType_param
{
local fileServerType=$1
if [ "$fileServerType" != "gluster" -a "$fileServerType" != "azurefiles" -a "$fileServerType" != "nfs" ]; then
echo "Invalid fileServerType ($fileServerType) given. Only 'gluster', 'azurefiles' or 'nfs' are allowed. Exiting"
exit 1
fi
}
function create_azure_files_moodle_share
{
local storageAccountName=$1
local storageAccountKey=$2
local logFilePath=$3
az storage share create \
--name moodle \
--account-name $storageAccountName \
--account-key $storageAccountKey \
--fail-on-exist >> $logFilePath
}
function setup_and_mount_azure_files_moodle_share
{
local storageAccountName=$1
local storageAccountKey=$2
cat <<EOF > /etc/moodle_azure_files.credential
username=$storageAccountName
password=$storageAccountKey
EOF
chmod 600 /etc/moodle_azure_files.credential
grep "^//$storageAccountName.file.core.windows.net/moodle\s\s*/moodle\s\s*cifs" /etc/fstab
if [ $? != "0" ]; then
echo -e "\n//$storageAccountName.file.core.windows.net/moodle /moodle cifs credentials=/etc/moodle_azure_files.credential,uid=www-data,gid=www-data,nofail,vers=3.0,dir_mode=0770,file_mode=0660,serverino,mfsymlinks" >> /etc/fstab
fi
mkdir -p /moodle
mount /moodle
}
# Functions for making NFS share available
# TODO refactor these functions with the same ones in install_gluster.sh
function scan_for_new_disks
{
local BLACKLIST=${1} # E.g., /dev/sda|/dev/sdb
declare -a RET
local DEVS=$(ls -1 /dev/sd*|egrep -v "${BLACKLIST}"|egrep -v "[0-9]$")
for DEV in ${DEVS};
do
# Check each device if there is a "1" partition. If not,
# "assume" it is not partitioned.
if [ ! -b ${DEV}1 ];
then
RET+="${DEV} "
fi
done
echo "${RET}"
}
function create_raid0_ubuntu {
local RAIDDISK=${1} # E.g., /dev/md1
local RAIDCHUNKSIZE=${2} # E.g., 128
local DISKCOUNT=${3} # E.g., 4
shift
shift
shift
local DISKS="$@"
dpkg -s mdadm
if [ ${?} -eq 1 ];
then
echo "installing mdadm"
sudo apt-get -y -q install mdadm
fi
echo "Creating raid0"
udevadm control --stop-exec-queue
echo "yes" | mdadm --create $RAIDDISK --name=data --level=0 --chunk=$RAIDCHUNKSIZE --raid-devices=$DISKCOUNT $DISKS
udevadm control --start-exec-queue
mdadm --detail --verbose --scan > /etc/mdadm/mdadm.conf
}
function do_partition {
# This function creates one (1) primary partition on the
# disk device, using all available space
local DISK=${1} # E.g., /dev/sdc
echo "Partitioning disk $DISK"
echo -ne "n\np\n1\n\n\nw\n" | fdisk "${DISK}"
#> /dev/null 2>&1
#
# Use the bash-specific $PIPESTATUS to ensure we get the correct exit code
# from fdisk and not from echo
if [ ${PIPESTATUS[1]} -ne 0 ];
then
echo "An error occurred partitioning ${DISK}" >&2
echo "I cannot continue" >&2
exit 2
fi
}
function add_local_filesystem_to_fstab {
local UUID=${1}
local MOUNTPOINT=${2} # E.g., /moodle
grep "${UUID}" /etc/fstab >/dev/null 2>&1
if [ ${?} -eq 0 ];
then
echo "Not adding ${UUID} to fstab again (it's already there!)"
else
LINE="\nUUID=${UUID} ${MOUNTPOINT} ext4 defaults,noatime 0 0"
echo -e "${LINE}" >> /etc/fstab
fi
}
function create_filesystem_with_raid {
local MOUNTPOINT=${1} # E.g., /moodle
local RAIDDISK=${2} # E.g., /dev/md1
local RAIDPARTITION=${3} # E.g., /dev/md1p1
mkdir -p $MOUNTPOINT
local DISKS=$(scan_for_new_disks "/dev/sda|/dev/sdb")
echo "Disks are ${DISKS}"
declare -i DISKCOUNT
local DISKCOUNT=$(echo "$DISKS" | wc -w)
echo "Disk count is $DISKCOUNT"
if [ $DISKCOUNT = "0" ];
then
echo "No new (unpartitioned) disks available... Returning..."
return
elif [ $DISKCOUNT -gt 1 ];
then
create_raid0_ubuntu /dev/md1 128 $DISKCOUNT $DISKS
do_partition ${RAIDDISK}
local PARTITION="${RAIDPARTITION}"
else
do_partition ${DISKS}
local PARTITION=$(fdisk -l ${DISKS}|grep -A 1 Device|tail -n 1|awk '{print $1}')
fi
echo "Creating filesystem on ${PARTITION}."
mkfs -t ext4 ${PARTITION}
mkdir -p "${MOUNTPOINT}"
local UUID=$(blkid -u filesystem ${PARTITION}|awk -F "[= ]" '{print $3}'|tr -d "\"")
add_local_filesystem_to_fstab "${UUID}" "${MOUNTPOINT}"
echo "Mounting disk ${PARTITION} on ${MOUNTPOINT}"
mount "${MOUNTPOINT}"
}
function configure_nfs_server_and_export {
local MOUNTPOINT=${1} # E.g., /moodle
echo "Installing nfs server..."
apt install -y nfs-kernel-server
echo "Exporting ${MOUNTPOINT}..."
grep "^${MOUNTPOINT}" /etc/exports > /dev/null 2>&1
if [ $? = "0" ]; then
echo "${MOUNTPOINT} is already exported. Returning..."
else
echo -e "\n${MOUNTPOINT} *(rw,sync,no_root_squash)" >> /etc/exports
systemctl restart nfs-kernel-server.service
fi
}
function configure_nfs_client_and_mount {
local NFS_SERVER=${1} # E.g., controller-vm-ab12cd
local NFS_DIR=${2} # E.g., /moodle
local MOUNTPOINT=${3} # E.g., /moodle
apt install -y nfs-common
mkdir -p ${MOUNTPOINT}
grep "^${NFS_SERVER}:${NFS_DIR}" /etc/fstab > /dev/null 2>&1
if [ $? = "0" ]; then
echo "${NFS_SERVER}:${NFS_DIR} already in /etc/fstab... skipping to add"
else
echo -e "\n${NFS_SERVER}:${NFS_DIR} ${MOUNTPOINT} nfs auto 0 0" >> /etc/fstab
fi
mount ${MOUNTPOINT}
}
SERVER_TIMESTAMP_FULLPATH="/moodle/html/moodle/.last_modified_time.moodle_on_azure"
LOCAL_TIMESTAMP_FULLPATH="/var/www/html/moodle/.last_modified_time.moodle_on_azure"
# Create a script to sync /moodle/html/moodle (gluster/NFS) and /var/www/html/moodle (local) and set up a minutely cron job
# Should be called by root and only on a VMSS web frontend VM
function setup_html_local_copy_cron_job {
if [ "$(whoami)" != "root" ]; then
echo "${0}: Must be run as root!"
return 1
fi
local SYNC_SCRIPT_FULLPATH="/usr/local/bin/sync_moodle_html_local_copy_if_modified.sh"
mkdir -p $(dirname ${SYNC_SCRIPT_FULLPATH})
local SYNC_LOG_FULLPATH="/var/log/moodle-html-sync.log"
cat <<EOF > ${SYNC_SCRIPT_FULLPATH}
#!/bin/bash
sleep \$((\$RANDOM%30))
if [ -f "$SERVER_TIMESTAMP_FULLPATH" ]; then
SERVER_TIMESTAMP=\$(cat $SERVER_TIMESTAMP_FULLPATH)
if [ -f "$LOCAL_TIMESTAMP_FULLPATH" ]; then
LOCAL_TIMESTAMP=\$(cat $LOCAL_TIMESTAMP_FULLPATH)
else
logger -p local2.notice -t moodle "Local timestamp file ($LOCAL_TIMESTAMP_FULLPATH) does not exist. Probably first time syncing? Continuing to sync."
mkdir -p /var/www/html
fi
if [ "\$SERVER_TIMESTAMP" != "\$LOCAL_TIMESTAMP" ]; then
logger -p local2.notice -t moodle "Server time stamp (\$SERVER_TIMESTAMP) is different from local time stamp (\$LOCAL_TIMESTAMP). Start syncing..."
if [[ \$(find $SYNC_LOG_FULLPATH -type f -size +20M 2> /dev/null) ]]; then
truncate -s 0 $SYNC_LOG_FULLPATH
fi
echo \$(date +%Y%m%d%H%M%S) >> $SYNC_LOG_FULLPATH
rsync -av --delete /moodle/html/moodle /var/www/html >> $SYNC_LOG_FULLPATH
fi
else
logger -p local2.notice -t moodle "Remote timestamp file ($SERVER_TIMESTAMP_FULLPATH) does not exist. Is /moodle mounted? Exiting with error."
exit 1
fi
EOF
chmod 500 ${SYNC_SCRIPT_FULLPATH}
local CRON_DESC_FULLPATH="/etc/cron.d/sync-moodle-html-local-copy"
cat <<EOF > ${CRON_DESC_FULLPATH}
* * * * * root ${SYNC_SCRIPT_FULLPATH}
EOF
chmod 644 ${CRON_DESC_FULLPATH}
}
LAST_MODIFIED_TIME_UPDATE_SCRIPT_FULLPATH="/usr/local/bin/update_last_modified_time_update.moodle_on_azure.sh"
# Create a script to modify the last modified timestamp file (/moodle/html/moodle/last_modified_time.moodle_on_azure)
# Should be called by root and only on the controller VM.
# The moodle admin should run the generated script everytime the /moodle/html/moodle directory content is updated (e.g., moodle upgrade, config change or plugin install/upgrade)
function create_last_modified_time_update_script {
if [ "$(whoami)" != "root" ]; then
echo "${0}: Must be run as root!"
return 1
fi
mkdir -p $(dirname $LAST_MODIFIED_TIME_UPDATE_SCRIPT_FULLPATH)
cat <<EOF > $LAST_MODIFIED_TIME_UPDATE_SCRIPT_FULLPATH
#!/bin/bash
echo \$(date +%Y%m%d%H%M%S) > $SERVER_TIMESTAMP_FULLPATH
EOF
chmod +x $LAST_MODIFIED_TIME_UPDATE_SCRIPT_FULLPATH
}
function run_once_last_modified_time_update_script {
$LAST_MODIFIED_TIME_UPDATE_SCRIPT_FULLPATH
}
# O365 plugins are released only for 'MOODLE_xy_STABLE',
# whereas we want to support the Moodle tagged versions (e.g., 'v3.4.2').
# This function helps getting the stable version # (for O365 plugin ver.)
# from a Moodle version tag. This utility function recognizes tag names
# of the form 'vx.y.z' only.
function get_o365plugin_version_from_moodle_version {
local moodleVersion=${1}
if [[ "$moodleVersion" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
echo "MOODLE_${BASH_REMATCH[1]}${BASH_REMATCH[2]}_STABLE"
else
echo $moodleVersion
fi
}
# For Moodle tags (e.g., "v3.4.2"), the unzipped Moodle dir is no longer
# "moodle-$moodleVersion", because for tags, it's without "v". That is,
# it's "moodle-3.4.2". Therefore, we need a separate helper function for that...
function get_moodle_unzip_dir_from_moodle_version {
local moodleVersion=${1}
if [[ "$moodleVersion" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
echo "moodle-${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}"
else
echo "moodle-$moodleVersion"
fi
}
# Long Redis cache Moodle config file generation code moved here
function create_redis_configuration_in_moodledata_muc_config_php
{
# create redis configuration in /moodle/moodledata/muc/config.php
cat <<EOF > /moodle/moodledata/muc/config.php
<?php defined('MOODLE_INTERNAL') || die();
\$configuration = array (
'siteidentifier' => '7a142be09ea65699e4a6f6ef91c0773c',
'stores' =>
array (
'default_application' =>
array (
'name' => 'default_application',
'plugin' => 'file',
'configuration' =>
array (
),
'features' => 30,
'modes' => 3,
'default' => true,
'class' => 'cachestore_file',
'lock' => 'cachelock_file_default',
),
'default_session' =>
array (
'name' => 'default_session',
'plugin' => 'session',
'configuration' =>
array (
),
'features' => 14,
'modes' => 2,
'default' => true,
'class' => 'cachestore_session',
'lock' => 'cachelock_file_default',
),
'default_request' =>
array (
'name' => 'default_request',
'plugin' => 'static',
'configuration' =>
array (
),
'features' => 31,
'modes' => 4,
'default' => true,
'class' => 'cachestore_static',
'lock' => 'cachelock_file_default',
),
'redis' =>
array (
'name' => 'redis',
'plugin' => 'redis',
'configuration' =>
array (
'server' => '$redisDns',
'prefix' => 'moodle_prod',
'password' => '$redisAuth',
'serializer' => '1',
),
'features' => 26,
'modes' => 3,
'mappingsonly' => false,
'class' => 'cachestore_redis',
'default' => false,
'lock' => 'cachelock_file_default',
),
'local_file' =>
array (
'name' => 'local_file',
'plugin' => 'file',
'configuration' =>
array (
'path' => '/tmp/muc/moodle_prod',
'autocreate' => 1,
),
'features' => 30,
'modes' => 3,
'mappingsonly' => false,
'class' => 'cachestore_file',
'default' => false,
'lock' => 'cachelock_file_default',
),
),
'modemappings' =>
array (
0 =>
array (
'store' => 'redis',
'mode' => 1,
'sort' => 0,
),
1 =>
array (
'store' => 'default_session',
'mode' => 2,
'sort' => 0,
),
2 =>
array (
'store' => 'default_request',
'mode' => 4,
'sort' => 0,
),
),
'definitions' =>
array (
'core/string' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 30,
'canuselocalstore' => true,
'component' => 'core',
'area' => 'string',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/langmenu' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'canuselocalstore' => true,
'component' => 'core',
'area' => 'langmenu',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/databasemeta' =>
array (
'mode' => 1,
'requireidentifiers' =>
array (
0 => 'dbfamily',
),
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 15,
'component' => 'core',
'area' => 'databasemeta',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/eventinvalidation' =>
array (
'mode' => 1,
'staticacceleration' => true,
'requiredataguarantee' => true,
'simpledata' => true,
'component' => 'core',
'area' => 'eventinvalidation',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/questiondata' =>
array (
'mode' => 1,
'simplekeys' => true,
'requiredataguarantee' => false,
'datasource' => 'question_finder',
'datasourcefile' => 'question/engine/bank.php',
'component' => 'core',
'area' => 'questiondata',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/htmlpurifier' =>
array (
'mode' => 1,
'canuselocalstore' => true,
'component' => 'core',
'area' => 'htmlpurifier',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/config' =>
array (
'mode' => 1,
'staticacceleration' => true,
'simpledata' => true,
'component' => 'core',
'area' => 'config',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/groupdata' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 2,
'component' => 'core',
'area' => 'groupdata',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/calendar_subscriptions' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'component' => 'core',
'area' => 'calendar_subscriptions',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/capabilities' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'ttl' => 3600,
'component' => 'core',
'area' => 'capabilities',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/yuimodules' =>
array (
'mode' => 1,
'component' => 'core',
'area' => 'yuimodules',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/observers' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 2,
'component' => 'core',
'area' => 'observers',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/plugin_manager' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'component' => 'core',
'area' => 'plugin_manager',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/coursecattree' =>
array (
'mode' => 1,
'staticacceleration' => true,
'invalidationevents' =>
array (
0 => 'changesincoursecat',
),
'component' => 'core',
'area' => 'coursecattree',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/coursecat' =>
array (
'mode' => 2,
'invalidationevents' =>
array (
0 => 'changesincoursecat',
1 => 'changesincourse',
),
'ttl' => 600,
'component' => 'core',
'area' => 'coursecat',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/coursecatrecords' =>
array (
'mode' => 4,
'simplekeys' => true,
'invalidationevents' =>
array (
0 => 'changesincoursecat',
),
'component' => 'core',
'area' => 'coursecatrecords',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/coursecontacts' =>
array (
'mode' => 1,
'staticacceleration' => true,
'simplekeys' => true,
'ttl' => 3600,
'component' => 'core',
'area' => 'coursecontacts',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/repositories' =>
array (
'mode' => 4,
'component' => 'core',
'area' => 'repositories',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/externalbadges' =>
array (
'mode' => 1,
'simplekeys' => true,
'ttl' => 3600,
'component' => 'core',
'area' => 'externalbadges',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/coursemodinfo' =>
array (
'mode' => 1,
'simplekeys' => true,
'canuselocalstore' => true,
'component' => 'core',
'area' => 'coursemodinfo',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/userselections' =>
array (
'mode' => 2,
'simplekeys' => true,
'simpledata' => true,
'component' => 'core',
'area' => 'userselections',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/completion' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'ttl' => 3600,
'staticacceleration' => true,
'staticaccelerationsize' => 2,
'component' => 'core',
'area' => 'completion',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/coursecompletion' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'ttl' => 3600,
'staticacceleration' => true,
'staticaccelerationsize' => 30,
'component' => 'core',
'area' => 'coursecompletion',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/navigation_expandcourse' =>
array (
'mode' => 2,
'simplekeys' => true,
'simpledata' => true,
'component' => 'core',
'area' => 'navigation_expandcourse',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/suspended_userids' =>
array (
'mode' => 4,
'simplekeys' => true,
'simpledata' => true,
'component' => 'core',
'area' => 'suspended_userids',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/roledefs' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 30,
'component' => 'core',
'area' => 'roledefs',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/plugin_functions' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 5,
'component' => 'core',
'area' => 'plugin_functions',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/tags' =>
array (
'mode' => 4,
'simplekeys' => true,
'staticacceleration' => true,
'component' => 'core',
'area' => 'tags',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/grade_categories' =>
array (
'mode' => 2,
'simplekeys' => true,
'invalidationevents' =>
array (
0 => 'changesingradecategories',
),
'component' => 'core',
'area' => 'grade_categories',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/temp_tables' =>
array (
'mode' => 4,
'simplekeys' => true,
'simpledata' => true,
'component' => 'core',
'area' => 'temp_tables',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/tagindexbuilder' =>
array (
'mode' => 2,
'simplekeys' => true,
'simplevalues' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 10,
'ttl' => 900,
'invalidationevents' =>
array (
0 => 'resettagindexbuilder',
),
'component' => 'core',
'area' => 'tagindexbuilder',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'core/contextwithinsights' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'component' => 'core',
'area' => 'contextwithinsights',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/message_processors_enabled' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 3,
'component' => 'core',
'area' => 'message_processors_enabled',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/message_time_last_message_between_users' =>
array (
'mode' => 1,
'simplekeys' => true,
'simplevalues' => true,
'datasource' => '\\core_message\\time_last_message_between_users',
'component' => 'core',
'area' => 'message_time_last_message_between_users',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/fontawesomeiconmapping' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'component' => 'core',
'area' => 'fontawesomeiconmapping',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/postprocessedcss' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => false,
'component' => 'core',
'area' => 'postprocessedcss',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'core/user_group_groupings' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'component' => 'core',
'area' => 'user_group_groupings',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'availability_grade/scores' =>
array (
'mode' => 1,
'staticacceleration' => true,
'staticaccelerationsize' => 2,
'ttl' => 3600,
'component' => 'availability_grade',
'area' => 'scores',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'availability_grade/items' =>
array (
'mode' => 1,
'staticacceleration' => true,
'staticaccelerationsize' => 2,
'ttl' => 3600,
'component' => 'availability_grade',
'area' => 'items',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'mod_glossary/concepts' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => false,
'staticacceleration' => true,
'staticaccelerationsize' => 30,
'component' => 'mod_glossary',
'area' => 'concepts',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'repository_googledocs/folder' =>
array (
'mode' => 1,
'simplekeys' => false,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 10,
'canuselocalstore' => true,
'component' => 'repository_googledocs',
'area' => 'folder',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'repository_onedrive/folder' =>
array (
'mode' => 1,
'simplekeys' => false,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 10,
'canuselocalstore' => true,
'component' => 'repository_onedrive',
'area' => 'folder',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'repository_skydrive/foldername' =>
array (
'mode' => 2,
'component' => 'repository_skydrive',
'area' => 'foldername',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'tool_mobile/plugininfo' =>
array (
'mode' => 1,
'simplekeys' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'component' => 'tool_mobile',
'area' => 'plugininfo',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'tool_monitor/eventsubscriptions' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 10,
'component' => 'tool_monitor',
'area' => 'eventsubscriptions',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 15,
),
'tool_uploadcourse/helper' =>
array (
'mode' => 4,
'component' => 'tool_uploadcourse',
'area' => 'helper',
'selectedsharingoption' => 2,
'userinputsharingkey' => '',
'sharingoptions' => 2,
),
'tool_usertours/tourdata' =>
array (
'mode' => 1,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'component' => 'tool_usertours',