moodle/admin/settings/development.php

87 lines
6.6 KiB
PHP
Raw Normal View History

<?php
2006-08-18 07:23:02 +00:00
// * Miscellaneous settings
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// Experimental settings page
$ADMIN->add('development', new admin_category('experimental', new lang_string('experimental','admin')));
$temp = new admin_settingpage('experimentalsettings', new lang_string('experimentalsettings', 'admin'));
//TODO: Re-enable cc-import once re-implemented in 2.0.x
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', new lang_string('enable_cc_import', 'imscc'), new lang_string('enable_cc_import_description', 'imscc'), 0));
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
// The CSS optimiser setting. When changed we need to reset the theme caches in order to ensure they are regenerated through the optimiser.
$enablecssoptimiser = new admin_setting_configcheckbox('enablecssoptimiser', new lang_string('enablecssoptimiser','admin'), new lang_string('enablecssoptimiser_desc','admin'), 0);
$enablecssoptimiser->set_updatedcallback('theme_reset_all_caches');
$temp->add($enablecssoptimiser);
$ADMIN->add('experimental', $temp);
// "debugging" settingpage
$temp = new admin_settingpage('debugging', new lang_string('debugging', 'admin'));
$temp->add(new admin_setting_special_debug());
$temp->add(new admin_setting_configcheckbox('debugdisplay', new lang_string('debugdisplay', 'admin'), new lang_string('configdebugdisplay', 'admin'), ini_get_bool('display_errors')));
$temp->add(new admin_setting_configcheckbox('debugsmtp', new lang_string('debugsmtp', 'admin'), new lang_string('configdebugsmtp', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('perfdebug', new lang_string('perfdebug', 'admin'), new lang_string('configperfdebug', 'admin'), '7', '15', '7'));
$temp->add(new admin_setting_configcheckbox('debugstringids', new lang_string('debugstringids', 'admin'), new lang_string('debugstringids_desc', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('debugvalidators', new lang_string('debugvalidators', 'admin'), new lang_string('configdebugvalidators', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('debugpageinfo', new lang_string('debugpageinfo', 'admin'), new lang_string('configdebugpageinfo', 'admin'), 0));
$ADMIN->add('development', $temp);
// "Profiling" settingpage (conditionally if the 'xhprof' extension is available only).
$xhprofenabled = extension_loaded('xhprof') && function_exists('xhprof_enable');
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'), 'moodle/site:config', !$xhprofenabled);
// Main profiling switch.
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
// List of URLs that will be automatically profiled.
$temp->add(new admin_setting_configtextarea('profilingincluded', new lang_string('profilingincluded', 'admin'), new lang_string('profilingincluded_help', 'admin'), ''));
// List of URLs that won't be profiled ever.
$temp->add(new admin_setting_configtextarea('profilingexcluded', new lang_string('profilingexcluded', 'admin'), new lang_string('profilingexcluded_help', 'admin'), ''));
// Allow random profiling each XX requests.
$temp->add(new admin_setting_configtext('profilingautofrec', new lang_string('profilingautofrec', 'admin'), new lang_string('profilingautofrec_help', 'admin'), 0, PARAM_INT));
// Allow PROFILEME/DONTPROFILEME GPC.
$temp->add(new admin_setting_configcheckbox('profilingallowme', new lang_string('profilingallowme', 'admin'), new lang_string('profilingallowme_help', 'admin'), false));
// Allow PROFILEALL/PROFILEALLSTOP GPC.
$temp->add(new admin_setting_configcheckbox('profilingallowall', new lang_string('profilingallowall', 'admin'), new lang_string('profilingallowall_help', 'admin'), false));
// TODO: Allow to skip PHP functions (XHPROF_FLAGS_NO_BUILTINS)
// TODO: Allow to skip call_user functions (ignored_functions array)
// Specify the life time (in minutes) of profiling runs.
$temp->add(new admin_setting_configselect('profilinglifetime', new lang_string('profilinglifetime', 'admin'), new lang_string('profilinglifetime_help', 'admin'), 24*60, array(
0 => new lang_string('neverdeleteruns', 'admin'),
30*24*60 => new lang_string('numdays', '', 30),
15*24*60 => new lang_string('numdays', '', 15),
7*24*60 => new lang_string('numdays', '', 7),
4*24*60 => new lang_string('numdays', '', 4),
2*24*60 => new lang_string('numdays', '', 2),
24*60 => new lang_string('numhours', '', 24),
16*80 => new lang_string('numhours', '', 16),
8*60 => new lang_string('numhours', '', 8),
4*60 => new lang_string('numhours', '', 4),
2*60 => new lang_string('numhours', '', 2),
60 => new lang_string('numminutes', '', 60),
30 => new lang_string('numminutes', '', 30),
15 => new lang_string('numminutes', '', 15))));
// Define the prefix to be added to imported profiling runs.
$temp->add(new admin_setting_configtext('profilingimportprefix',
new lang_string('profilingimportprefix', 'admin'),
new lang_string('profilingimportprefix_desc', 'admin'), '(I)', PARAM_TAG, 10));
// Add the 'profiling' page to admin block.
$ADMIN->add('development', $temp);
// Web service test clients DO NOT COMMIT : THE EXTERNAL WEB PAGE IS NOT AN ADMIN PAGE !!!!!
$ADMIN->add('development', new admin_externalpage('testclient', new lang_string('testclient', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/testclient.php"));
mnet MDL-21261 large overhaul. This commit changes: - The way that mnet rpc functions are registered. Plugins must now create db/mnet.php which is an array, similar to services.php. This *replaces* the old mnet_publishes() functions. version.php must be bumped to trigger this. - More information about each rpc-available function is stored in the database, including the class it belongs to, the file it is found in, and whether or not it is static. Methods that are not static must be in a class with a constructor that takes no arguments (this can easily be achieved with a small wrapper if necessary) - The xmlrpc dispatcher has been rewritten to remove all the dependencies on hardcoded information about auth,mnet,portfolio and repository, and just use the information in the database. - The old hardcoded hidden mnet/testclient.php has been moved to the Admin menu under "Development" and rewritten. - The xmlrpc introspection method profiling is now using php and zend reflection - which is a lot nicer than the old way, which was using a php-based php parser. This fixes some inconsistent handling of methods without arguments that were advertising their return value as the only method parameter. While this is a *fix*, it breaks BC slightly - the old 1.9 broken mnet/testclient.php will now not work properly with 2.0 - Dangerous mode is still supported, but old mod/*/rpclib.php is now unsupported, due to the fact that any plugin can export mnet functions with db/mnet.php. This is a slight BC break. Still TODO: - TEST TEST TEST - Document the two small BC breaks in release notes - Document the contract for db/mnet.php
2010-01-28 05:25:50 +00:00
if ($CFG->mnet_dispatcher_mode !== 'off') {
$ADMIN->add('development', new admin_externalpage('mnettestclient', new lang_string('testclient', 'mnet'), "$CFG->wwwroot/$CFG->admin/mnet/testclient.php"));
mnet MDL-21261 large overhaul. This commit changes: - The way that mnet rpc functions are registered. Plugins must now create db/mnet.php which is an array, similar to services.php. This *replaces* the old mnet_publishes() functions. version.php must be bumped to trigger this. - More information about each rpc-available function is stored in the database, including the class it belongs to, the file it is found in, and whether or not it is static. Methods that are not static must be in a class with a constructor that takes no arguments (this can easily be achieved with a small wrapper if necessary) - The xmlrpc dispatcher has been rewritten to remove all the dependencies on hardcoded information about auth,mnet,portfolio and repository, and just use the information in the database. - The old hardcoded hidden mnet/testclient.php has been moved to the Admin menu under "Development" and rewritten. - The xmlrpc introspection method profiling is now using php and zend reflection - which is a lot nicer than the old way, which was using a php-based php parser. This fixes some inconsistent handling of methods without arguments that were advertising their return value as the only method parameter. While this is a *fix*, it breaks BC slightly - the old 1.9 broken mnet/testclient.php will now not work properly with 2.0 - Dangerous mode is still supported, but old mod/*/rpclib.php is now unsupported, due to the fact that any plugin can export mnet functions with db/mnet.php. This is a slight BC break. Still TODO: - TEST TEST TEST - Document the two small BC breaks in release notes - Document the contract for db/mnet.php
2010-01-28 05:25:50 +00:00
}
$ADMIN->add('development', new admin_externalpage('purgecaches', new lang_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));
$ADMIN->add('development', new admin_externalpage('thirdpartylibs', new lang_string('thirdpartylibs','admin'), "$CFG->wwwroot/$CFG->admin/thirdpartylibs.php"));
} // end of speedup