MDL-41838 Backup/restore: Support .tar.gz format for .mbz (2 of 2)
[moodle.git] / admin / settings / development.php
CommitLineData
11b749ca 1<?php
a7c72afc 2
721d74b0 3// * Miscellaneous settings
50999a0b 4
a559f630 5if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
6
220a90c5 7 // Experimental settings page
e106013f 8 $ADMIN->add('development', new admin_category('experimental', new lang_string('experimental','admin')));
3b49f849 9
e106013f 10 $temp = new admin_settingpage('experimentalsettings', new lang_string('experimentalsettings', 'admin'));
cbb9e9b8 11 //TODO: Re-enable cc-import once re-implemented in 2.0.x
e106013f
SH
12 //$temp->add(new admin_setting_configcheckbox('enableimsccimport', new lang_string('enable_cc_import', 'imscc'), new lang_string('enable_cc_import_description', 'imscc'), 0));
13 $temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
14 $temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0));
a559f630 15
1ddc3d1f 16 $temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
514d31c8
SH
17 // The CSS optimiser setting. When changed we need to reset the theme caches in order to ensure they are regenerated through the optimiser.
18 $enablecssoptimiser = new admin_setting_configcheckbox('enablecssoptimiser', new lang_string('enablecssoptimiser','admin'), new lang_string('enablecssoptimiser_desc','admin'), 0);
19 $enablecssoptimiser->set_updatedcallback('theme_reset_all_caches');
20 $temp->add($enablecssoptimiser);
f684250b 21
39e5102f 22 // Backup archive .mbz format: switching to .tar.gz enables larger files, better
23 // progress reporting and possibly better performance. This is an experimental
24 // setting but if successful, should be removed and enabled by default in a future
25 // version. Note: this setting controls newly-created backups only; restore always
26 // supports both formats.
27 $temp->add(new admin_setting_configcheckbox('enabletgzbackups',
28 new lang_string('enabletgzbackups', 'admin'),
29 new lang_string('enabletgzbackups_desc', 'admin'), 0));
30
3b49f849 31 $ADMIN->add('experimental', $temp);
32
7689a0f3 33 // "debugging" settingpage
e106013f 34 $temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
7689a0f3 35 $temp->add(new admin_setting_special_debug());
e106013f 36 $temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
e106013f
SH
37 $temp->add(new admin_setting_configcheckbox('debugsmtp', new lang_string('debugsmtp', 'admin'), new lang_string('configdebugsmtp', 'admin'), 0));
38 $temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
39 $temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
40 $temp->add(new admin_setting_configcheckbox('debugvalidators', new lang_string('debugvalidators', 'admin'), new lang_string('configdebugvalidators', 'admin'), 0));
41 $temp->add(new admin_setting_configcheckbox('debugpageinfo', new lang_string('debugpageinfo', 'admin'), new lang_string('configdebugpageinfo', 'admin'), 0));
7689a0f3 42 $ADMIN->add('development', $temp);
43
6af80cae
EL
44 // "profiling" settingpage (conditionally if the 'xhprof' extension is available only)
45 if (extension_loaded('xhprof') && function_exists('xhprof_enable')) {
e106013f 46 $temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'));
6af80cae 47 // Main profiling switch
e106013f 48 $temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
6af80cae 49 // List of URLs that will be automatically profiled
e106013f 50 $temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
6af80cae 51 // List of URLs that won't be profiled ever
e106013f 52 $temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
6af80cae 53 // Allow random profiling each XX requests
e106013f 54 $temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
6af80cae 55 // Allow PROFILEME/DONTPROFILEME GPC
e106013f 56 $temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
6af80cae 57 // Allow PROFILEALL/PROFILEALLSTOP GPC
e106013f 58 $temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
6af80cae
EL
59 // TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
60 // TODO: Allow to skip call_user functions (ignored_functions array)
61 // Specify the life time (in minutes) of profiling runs
e106013f
SH
62 $temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
63 0 => new lang_string('neverdeleteruns', 'admin'),
64 30*24*60 => new lang_string('numdays', '', 30),
65 15*24*60 => new lang_string('numdays', '', 15),
66 7*24*60 => new lang_string('numdays', '', 7),
67 4*24*60 => new lang_string('numdays', '', 4),
68 2*24*60 => new lang_string('numdays', '', 2),
69 24*60 => new lang_string('numhours', '', 24),
70 16*80 => new lang_string('numhours', '', 16),
71 8*60 => new lang_string('numhours', '', 8),
72 4*60 => new lang_string('numhours', '', 4),
73 2*60 => new lang_string('numhours', '', 2),
74 60 => new lang_string('numminutes', '', 60),
75 30 => new lang_string('numminutes', '', 30),
76 15 => new lang_string('numminutes', '', 15))));
2e746b72
EL
77 // Define the prefix to be added to imported profiling runs.
78 $temp->add(new admin_setting_configtext('profilingimportprefix',
79 new lang_string('profilingimportprefix', 'admin'),
80 new lang_string('profilingimportprefix_desc', 'admin'), '(I)', PARAM_TAG, 10));
6af80cae
EL
81
82 // Add the 'profiling' page to admin block
83 $ADMIN->add('development', $temp);
84 }
85
7689a0f3 86
75537cbf 87 // Web service test clients DO NOT COMMIT : THE EXTERNAL WEB PAGE IS NOT AN ADMIN PAGE !!!!!
e106013f 88 $ADMIN->add('development', new admin_externalpage('testclient', new lang_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
75537cbf 89
90
de260e0f 91 if ($CFG->mnet_dispatcher_mode !== 'off') {
e106013f 92 $ADMIN->add('development', new admin_externalpage('mnettestclient', new lang_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
de260e0f 93 }
ba6c97ee 94
e106013f 95 $ADMIN->add('development', new admin_externalpage('purgecaches', new lang_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
a559f630 96} // end of speedup