Merge branch 'w02_MDL-30717_m23_usercreated' of git://github.com/skodak/moodle
[moodle.git] / admin / settings / development.php
blob9d7b5a099813d9e8d3e38124367ff62eb30993ce
1 <?php
3 // * Miscellaneous settings
5 if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
7 // Experimental settings page
8 $ADMIN->add('development', new admin_category('experimental', new lang_string('experimental','admin')));
10 $temp = new admin_settingpage('experimentalsettings', new lang_string('experimentalsettings', 'admin'));
11 //TODO: Re-enable cc-import once re-implemented in 2.0.x
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));
16 $ADMIN->add('experimental', $temp);
18 // "debugging" settingpage
19 $temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
20 $temp->add(new admin_setting_special_debug());
21 $temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
22 $temp->add(new admin_setting_configcheckbox('xmlstrictheaders', new lang_string('xmlstrictheaders', 'admin'), new lang_string('configxmlstrictheaders', 'admin'), 0));
23 $temp->add(new admin_setting_configcheckbox('debugsmtp', new lang_string('debugsmtp', 'admin'), new lang_string('configdebugsmtp', 'admin'), 0));
24 $temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
25 $temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
26 $temp->add(new admin_setting_configcheckbox('debugvalidators', new lang_string('debugvalidators', 'admin'), new lang_string('configdebugvalidators', 'admin'), 0));
27 $temp->add(new admin_setting_configcheckbox('debugpageinfo', new lang_string('debugpageinfo', 'admin'), new lang_string('configdebugpageinfo', 'admin'), 0));
28 $ADMIN->add('development', $temp);
30 // "profiling" settingpage (conditionally if the 'xhprof' extension is available only)
31 if (extension_loaded('xhprof') && function_exists('xhprof_enable')) {
32 $temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'));
33 // Main profiling switch
34 $temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
35 // List of URLs that will be automatically profiled
36 $temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
37 // List of URLs that won't be profiled ever
38 $temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
39 // Allow random profiling each XX requests
40 $temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
41 // Allow PROFILEME/DONTPROFILEME GPC
42 $temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
43 // Allow PROFILEALL/PROFILEALLSTOP GPC
44 $temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
45 // TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
46 // TODO: Allow to skip call_user functions (ignored_functions array)
47 // Specify the life time (in minutes) of profiling runs
48 $temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
49 0 => new lang_string('neverdeleteruns', 'admin'),
50 30*24*60 => new lang_string('numdays', '', 30),
51 15*24*60 => new lang_string('numdays', '', 15),
52 7*24*60 => new lang_string('numdays', '', 7),
53 4*24*60 => new lang_string('numdays', '', 4),
54 2*24*60 => new lang_string('numdays', '', 2),
55 24*60 => new lang_string('numhours', '', 24),
56 16*80 => new lang_string('numhours', '', 16),
57 8*60 => new lang_string('numhours', '', 8),
58 4*60 => new lang_string('numhours', '', 4),
59 2*60 => new lang_string('numhours', '', 2),
60 60 => new lang_string('numminutes', '', 60),
61 30 => new lang_string('numminutes', '', 30),
62 15 => new lang_string('numminutes', '', 15))));
64 // Add the 'profiling' page to admin block
65 $ADMIN->add('development', $temp);
69 // Web service test clients DO NOT COMMIT : THE EXTERNAL WEB PAGE IS NOT AN ADMIN PAGE !!!!!
70 $ADMIN->add('development', new admin_externalpage('testclient', new lang_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
73 if ($CFG->mnet_dispatcher_mode !== 'off') {
74 $ADMIN->add('development', new admin_externalpage('mnettestclient', new lang_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
77 $ADMIN->add('development', new admin_externalpage('purgecaches', new lang_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
78 } // end of speedup