Commit graph

19 commits

Author SHA1 Message Date
tjhunt
bb45fe62c4 get_string: Refactoring, performance improvements, bug fixes and unit tests
MDL-18669 get_string refactored to elimiate duplicate code and make it easier to understand.
MDL-17763 parent language not processed correctly when getting a plugin string.
MDL-16181 more intelligent caching to avoid repeated file_exists checks.
MDL-12434 move values to array keys to improve lookup times.

The main part of the refactoring is to create a singleton string_manager class to encapsulate the cached data and the processing, while breaking the code up into more smaller methods.

Other performance improvements include:
* Cache results of plugin name -> locations to search array.
* Cache parent lang lookup.
* Skip eval if the string does not contain $ \ or %.
* Remove the unnecessary sprintf from the eval.

There is a performance testing script in lib/simpletest/getstringperformancetester.php. For now this script has the old get_string implementation copied and pasted to the end, and renamed to old_get_string to allow for comparitive timings.

There are now some unit tests for get_string in lib/simpletest/teststringmanager.php. I think I have managed to cover most of the tricky cases.
2009-03-30 02:21:27 +00:00
nicolasconnault
ec0123208d MDL-18188 Added a new function with matching unit tests, following Sam's comment in the tracker 2009-02-10 15:33:25 +00:00
skodak
cc4245a3cd MDL-16483 - stopped using MoodleUnitTestCase in tests where $DB not needed 2009-01-10 13:23:37 +00:00
skodak
e70da470a7 MDL-14123 Full IPv6 support - reimplemented address_in_subnet() + added more unittests 2009-01-09 21:16:26 +00:00
skodak
65de686486 MDL-14123 cleanremoteaddr improvements and added unit tests 2009-01-09 10:16:07 +00:00
tjhunt
6ff2be37f5 moodlelib iprange checks: MDL-16986 If the user makes a mistake and types something like 172.16.1.143/148, with something greater than 32 after the slash, treat it as /32. 2008-10-24 02:53:51 +00:00
nicolasconnault
b9c639d6c2 MDL-16483 Refactored install/upgrade code into lib/adminlib. Created an intermediate MoodleUnitTestCase class that overrides simpletest's constructor, destructor and setup/teardown methods. All moodle unit tests must extend this class. 2008-09-16 12:19:43 +00:00
tjhunt
1cc6b5162c MDL-15655 - address_in_subnet does not work on 64 bit architectures. Also, we found some other issues with this funtion while diagnosing the problem. 2008-09-01 04:17:11 +00:00
skodak
bed7993115 MDL-15897 deprecated PARAM_CLEANFILE - we now support unicode everywhere 2008-07-31 23:03:50 +00:00
tjhunt
c7fd861b8e Unit tests for MDL-9295 - clean_param with PARAM_URL/PARAM_LOCALURL. Merged from MOODLE_18_STABLE. 2007-10-30 10:46:26 +00:00
nicolasconnault
56a1a88228 MDL-8605 New user directories implemented 2007-10-11 09:01:29 +00:00
nicolasconnault
b7064779f5 Updated copyright notice in header 2007-10-10 05:25:14 +00:00
skodak
cdbbd26f80 MDL-10064 global $CFG in unit test files is non standard, it is recommended to use MOODLE_INTERNAL test in all library files 2007-06-09 16:32:36 +00:00
skodak
52f81103d3 MDL-10063 simpletestlib.php included from majority of unit tests - let's include it once from the test runner itself 2007-06-09 16:17:33 +00:00
nicolasconnault
facb512c06 MDL-8792 - Simply added help icon to explain the options available regarding embedding media files in the site. 2007-03-12 05:46:41 +00:00
nicolasconnault
a205dcdc09 Upgraded weblib::format_string() so it accepts unicode htmlentities. Also added more unit tests, including a stub for an integration web-based test. 2007-03-06 05:05:45 +00:00
nicolasconnault
d499142e5a Safari 2.0 and Opera 9.0 are now detected and supported for YUI. However, preliminary tests show that drag&drop behaviour is very slow on Opera and user-unfriendly on both browsers. A YUI debug window also pops up on Safari.
I added a unit test for ajaxlib.php

Issue MDL-8417
Merged from MOODLE_18_STABLE
2007-03-01 01:31:37 +00:00
moodler
239c15765c Merged from 1.8 stable 2007-02-28 07:58:34 +00:00
tjhunt
7c9d46c96e Related to MDL-6249 - unit tests for address_in_subnet. Merged from MOODLE_17_STABLE. 2006-10-16 13:40:26 +00:00